I have an issue I'm facing and I'm wondering if th...
# getting-started
s
I have an issue I'm facing and I'm wondering if there's a good way in kotlin to deal with it. Basically I have some information in a config file. I'm using jackson to parse the yaml file and convert it into an object that I defined. Right now, I'm reading the data like this:
Copy code
val mapper = ObjectMapper(YAMLFactory())
mapper.registerModule(KotlinModule())

FileInputStream("${System.getProperty("user.dir")}/src/main/resources/config.yml").use {
        mapper.readValue(it, ConfigDto::class.java)
    }
This works fine when I'm running within my IDE, but when I jar it up and try to run the jar it obviously doesn't work. I figured I'd reach out here to see if anyone know of a good way to read data from that properties file just by calling
java -jar foo.jar