How to use drawing platform configuration command-line options in a non-playing application

In a game application, I can add command line options to override the default configuration in resources:

... -Dconfig.file=/opt/conf/prod.conf

I am developing a non-playback application with a playback configuration library and am creating a jar using sbt-assembly.

Upd
I want to use command line options:

java -jar my-app.jar -Dconfig.file=/opt/conf/prod.conf

but there is no effect. I load the configuration with:

ConfigFactory.load()

Do I have to manually enable cmd options and upload the file to config?

+4
source share
2 answers

I found an error:

-Dconfig.file - . -jar. . :

java -Dconfig.file=/opt/conf/prod.conf -jar my-app.jar
+5

typesafe-config. https://github.com/typesafehub/config

, build.sbt Config.

0

Source: https://habr.com/ru/post/1620055/


All Articles