使用spring-boot gradle-plugin构建的可执行jar缺少依赖项

Már*_*reg 5 java spring gradle spring-boot

我有一个可执行的JAR,我用Spring Boot的Gradle插件构建.它在构建文件中具有以下依赖项:

的build.gradle

compile('org.apache.activemq:activemq-client:5.9.0')
compile('org.apache.activemq:activemq-broker:5.9.0')
compile('org.apache.activemq:activemq-kahadb-store:5.9.0')
compile('org.apache.activemq.protobuf:activemq-protobuf:1.1')
Run Code Online (Sandbox Code Playgroud)

问题是我运行后 ./gradlew clean build 创建的工件不包含activemq-protobufjar,只有其他activemq jar:

[] jar -tf build/libs/application-0.1.0.jar | grep activemq
lib/activemq-client-5.9.0.jar
lib/activemq-broker-5.9.0.jar
lib/activemq-kahadb-store-5.9.0.jar
lib/activemq-openwire-legacy-5.9.0.jar
Run Code Online (Sandbox Code Playgroud)

因此,当我尝试运行jar时,我得到一个异常,即无法找到此依赖项中的类:

java.lang.ClassNotFoundException: org.apache.activemq.protobuf.Message
Run Code Online (Sandbox Code Playgroud)

在构建期间,依赖项被下载并且可以在我的gradle缓存中找到,似乎由于某种原因,Spring Boot的Gradle插件在bootRepackage任务期间不包含它.

这种依赖关系也存在于Eclipse中,项目可以从那里运行.

关于它为何失踪的任何想法?

And*_*son 1

这看起来像是 Spring Boot 中的一个错误。我已经提出了一个问题以便我们进行调查。感谢您提请我们注意。