Hello, sorry for the noob question (new to Kotlin ...
# ktor
k
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
Use any serialisation framework to read yaml or json file
Or toml
You can even write a one liner to read ini format
Frameworks that come to mind - Jackson databind, Gson, kotlinx serialisation, many more
k
Thank you for leading to the right direction Dico ! I’ll give a try to YAML and SnakeYAML. 👍
k
isnt something like this you are looking for https://ktor.io/servers/configuration.html?
k
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?
k
yes