【问题标题】:Include Hortonworks respository in Spring Boot executable jar在 Spring Boot 可执行 jar 中包含 Hortonworks 存储库
【发布时间】:2019-06-19 09:49:05
【问题描述】:

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

 <repositories>
    <repository>
        <id>repository.hortonworks</id>
        <name>Hortonworks Repository</name>
        <url>http://repo.hortonworks.com/content/repositories/releases/</url>
    </repository>
</repositories>

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

<dependency>
      <groupId>com.hortonworks</groupId>
      <artifactId>shc-core</artifactId>
      <version>1.1.1-2.1-s_2.11</version>
  </dependency>

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

我已经尝试了启用&lt;includeSystemScope&gt;true&lt;/includeSystemScope&gt; 配置的系统范围。但这也没有用。

谁能告诉我我做错了什么?

【问题讨论】:

    标签: java maven spring-boot apache-spark hbase


    【解决方案1】:

    尝试在 pom.xml 中添加

    <build>
      <plugins>
        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <configuration>
            <archive>
              <manifest>
                <mainClass>fully.qualified.MainClass</mainClass>
              </manifest>
            </archive>
            <descriptorRefs>
              <descriptorRef>jar-with-dependencies</descriptorRef>
            </descriptorRefs>
          </configuration>
        </plugin>
      </plugins>
    </build>
    

    运行::

    mvn clean compile install assembly:single

    【讨论】:

      猜你喜欢
      • 2018-05-26
      • 1970-01-01
      • 2017-09-15
      • 1970-01-01
      • 2014-12-18
      • 2017-11-21
      • 2017-01-20
      • 1970-01-01
      • 2019-07-27
      相关资源
      最近更新 更多