I have a scala project which I've been running fine inside IntelliJ with a Run/Debug configuration set to Application, and now I'd like to create a jar to run it using 'java -jar .jar'. This is a maven project, not SBT.
I have three modules, and the top module which includes all other modules has an reference.conf in the resources folder. It's a minimal application.conf, not a lot of settings. Another one of the modules has its own reference.conf.
I created an artifact based on my top module, and I build it to create a jar. When I execute it with java
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.se.pd.Main.main(Main.scala)
Caused by: com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'akka.version'
at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:124)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:145)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:151)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:159)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:164)
at com.typesafe.config.impl.SimpleConfig.getString(SimpleConfig.java:206)
at akka.actor.ActorSystem$Settings.<init>(ActorSystem.scala:168)
at akka.actor.ActorSystemImpl.<init>(ActorSystem.scala:504)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:141)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:118)
at com.se.pd.ServiceMain$class.$init$(ServiceMain.scala:25)
at com.se.pd.Main$.<init>(Main.scala:17)
at com.se.pd.Main$.<clinit>(Main.scala)
When I unzip the file, I see the merged reference.conf in the root dir.
What am I missing? Do I need to do something specific when I create my ActorSystem? I tried deleting all of my config files and running with all defaults, and it still didn't work, although in that case the error changed from complaining about "akka.version" to complaining about "akka". So it feels liek somehow I'm just not loading the akka defaults?