I’ve built a simple Akka system with dependencies on Akka cluster libraries as follows (my Maven pom file):
<dependencies>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-cluster-tools_2.12</artifactId>
<version>2.5.23</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-cluster-metrics_2.12</artifactId>
<version>2.5.23</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-stream_2.12</artifactId>
<version>2.5.23</version>
</dependency>
I can run the cluster just find from Maven, but when I create an executable jar file and try to run it that way I get an Exception in thread “main” java.lang.NoClassDefFoundError: com/typesafe/config/ConfigMergeable.
Since the samples run just fine using the same dependencies, and my code runs just fine when I execute the main method from Maven, I can’t figure out why the TypeSafe Config library isn’t being included when I package the jar file. Shouldn’t it be part of the core Akka dependencies already?