我使用了akka docs中给出的maven-shade-plugin ,它创建了一个阴影jar,maven build的以下输出证明了这一点:
[INFO] --- maven-shade-plugin:2.4.2:shade (default) @ remoting.example ---
[INFO] Including com.typesafe.akka:akka-remote_2.11:jar:2.4.8 in the shaded jar.
[INFO] Including org.scala-lang:scala-library:jar:2.11.8 in the shaded jar.
[INFO] Including com.typesafe.akka:akka-protobuf_2.11:jar:2.4.8 in the shaded jar.
[INFO] Including io.netty:netty:jar:3.10.6.Final in the shaded jar.
[INFO] Including org.uncommons.maths:uncommons-maths:jar:1.2.2a in the shaded jar.
[INFO] Including com.typesafe.akka:akka-actor_2.11:jar:2.4.8 in the shaded jar.
[INFO] Including com.typesafe:config:jar:1.3.0 in the shaded jar.
[INFO] Including org.scala-lang.modules:scala-java8-compat_2.11:jar:0.7.0 in the shaded jar.
[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing /home/dschulze/src/java/akka/remoting.example/target/remoting.example-0.0.1-SNAPSHOT.jar with /home/dschulze/src/java/akka/remoting.example/target/remoting.example-0.0.1-SNAPSHOT-shaded.jar
[INFO] Dependency-reduced POM written at: /home/dschulze/src/java/akka/remoting.example/dependency-reduced-pom.xml
当我运行 jar-with-dependencies 我仍然得到
Exception in thread "main" com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'akka.version'
我还尝试了在网络上的各种帖子中找到的其他几个,但没有一个创建一个可以工作的 jar-with-dependencies。如何创建一个使用 akka 的 jar-with-dependencies?