0

I am trying to build an executeable JAR with a custom config file.

In Eclpise all is working fine but in the jar file the config file is missing.

I tried it in different ways. I put the application.conf in directory "Conf" and in "Resources". In addition to that I tried with following Statements in the code-section.

Does anyone have an Idea?

PS. The application.conf of Jooby is based on this:

https://github.com/lightbend/config

PS2:

I let the config write out to the console. How expected, in Eclipse all custom settings are set. In my Jar File the Configuration only contains things like port and name of application and tons of system settings (Java version, Path xyz, ...). So it does not merge my custom config settings to the system-settings :(

//Config conf = ConfigFactory.parseResources("application.conf");
Config conf = require(Config.class);
//Config conf = ConfigFactory.load();
//Config conf = App.class.getResourceAsStream("application.conf");
Buzz
  • 315
  • 6
  • 18
  • Update: If I start the application with this argument: -Dconfig.file=application.conf, then it works. But I want to have the conf file within the jar. – Buzz Oct 07 '19 at 15:02
  • Next Update: With this config it works: Config conf = ConfigFactory.load(); in code. conf/application.conf in Maven-File. And as argument: -Dconfig.resource=conf/application.conf ........ Now I want to open without the argument – Buzz Oct 07 '19 at 15:15

0 Answers0