java-在Spring Boot可执行jar中包含Hortonworks存储库

前端之家收集整理的这篇文章主要介绍了java-在Spring Boot可执行jar中包含Hortonworks存储库 前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我在Spring Boot应用程序中使用Hortonworks存储库中的shc-core依赖项,该存储库在pom.xml文件中声明如下:

  1. <repositories>
  2. <repository>
  3. <id>repository.hortonworks</id>
  4. <name>Hortonworks Repository</name>
  5. <url>http://repo.hortonworks.com/content/repositories/releases/</url>
  6. </repository>
  7. </repositories>

我从此存储库添加的依赖项是:

  1. <dependency>
  2. <groupId>com.hortonworks</groupId>
  3. <artifactId>shc-core</artifactId>
  4. <version>1.1.1-2.1-s_2.11</version>
  5. </dependency>

我正在使用spring-boot-maven-plugin构建可执行的jar文件.但是当我mvn clean install或mvn clean install spring-boot:repackage时,它没有将shc-core jar打包在Spring Boot可执行jar文件中.

我已经尝试使用< includeSystemScope> true< / includeSystemScope>启用配置.但这也不起作用.

有人可以告诉我我在做什么错吗?

最佳答案
尝试添加pom.xml

  1. <build>
  2. <plugins>
  3. <plugin>
  4. <artifactId>maven-assembly-plugin</artifactId>
  5. <configuration>
  6. <archive>
  7. <manifest>
  8. <mainClass>fully.qualified.MainClass</mainClass>
  9. </manifest>
  10. </archive>
  11. <descriptorRefs>
  12. <descriptorRef>jar-with-dependencies</descriptorRef>
  13. </descriptorRefs>
  14. </configuration>
  15. </plugin>
  16. </plugins>
  17. </build>

跑::

mvn clean编译安装程序集:单个

猜你在找的Java相关文章