简体   繁体   中英

Include Hortonworks respository in Spring Boot executable jar

I'm using the shc-core dependency from the Hortonworks repository in a Spring Boot application, with the repository declared in the pom.xml file as follows:

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

The dependency that I'm adding from this repository is this:

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

I'm using spring-boot-maven-plugin to build an executable jar file. But when I mvn clean install or mvn clean install spring-boot:repackage , it is not packaging the shc-core jar in the Spring Boot executable jar file.

I've already tried the system scope with <includeSystemScope>true</includeSystemScope> configuration enabled. But that didn't work either.

Can anybody tell me what I'm doing wrong?

Try adding in 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>

and

run::

mvn clean compile install assembly:single

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM