Executable Jar cannot find typesafe/config application.conf on classpath

后端 未结 2 873
天命终不由人
天命终不由人 2021-01-14 08:53

I have a command line app that downloads some reports, processes them, then uploads data to Google Drive. I\'m using Typesafe-Config for all the magic strings I need. Typesa

2条回答
  •  梦毁少年i
    2021-01-14 09:19

    As I just had the same problem...

    The -jar overrides all classpath settings, so only the jar is seen. -Dconfig.trace=loads will show what is seen by java.

    We want the application.conf on the classpath, as well as the jar, so: java -cp .:my-reports-1.0-SNAPSHOT.jar full.path.to.main.Main did the trick for me. application.conf found and overrides reference.conf in the jar.

提交回复
热议问题