Hello, sorry for the noob question (new to Kotlin and JVM world). After succeeding in generating a working fat jar file with Shadowjar, I’d like to know how I can create an external config file to be used with that fat jar so that parameters can be read from that external file.
Something similar to the application.conf but not in the jar itself so that we can amend the values whenever needed.
Thanks for your help !
d
Dico
08/16/2019, 11:20 PM
Use any serialisation framework to read yaml or json file
Dico
08/16/2019, 11:20 PM
Or toml
Dico
08/16/2019, 11:20 PM
You can even write a one liner to read ini format
Dico
08/16/2019, 11:22 PM
Frameworks that come to mind - Jackson databind, Gson, kotlinx serialisation, many more
k
keochris
08/18/2019, 6:55 PM
Thank you for leading to the right direction Dico ! I’ll give a try to YAML and SnakeYAML. 👍
Actually, yes, it looks closer to what I was thinking of.
Basically I should use an HOCON file that will be located in a place that can be called by adding a parameter with a switch when calling the jar.
Is that what you thought of?