SpringBoot在BOOT-INF / lib /文件夹中找不到我的依赖项

时间:2018-01-24 19:44:43

标签: java spring maven spring-boot

我可以使用IDE或mvn spring-boot:run完美地运行springBoot APP,但我不能这样做:

java -jar myapp-0.1.jar

PS。:我将myproject-0.1嵌入到digitalizacao-sender-0.0.1.jar

因为我说错误

   Caused by: java.lang.IllegalArgumentException: File [/home/myuser/workspace/digitalizacao-sender/target/digitalizacao-sender-0.0.1.jar!/BOOT-INF/lib/myproject-0.1.jar] referenced by given URL [file:/home/myuser/workspace/digitalizacao-sender/target/digitalizacao-sender-0.0.1.jar!/BOOT-INF/lib/myproject-0.1.jar] does not exist
    at org.hibernate.jpa.boot.archive.internal.StandardArchiveDescriptorFactory.buildArchiveDescriptor(StandardArchiveDescriptorFactory.java:73) ~[myproject-0.1.jar!/:na]
    at org.hibernate.jpa.boot.archive.internal.StandardArchiveDescriptorFactory.buildArchiveDescriptor(StandardArchiveDescriptorFactory.java:48) ~[myproject-0.1.jar!/:na]
    at org.hibernate.jpa.boot.scan.spi.AbstractScannerImpl.buildArchiveDescriptor(AbstractScannerImpl.java:95) ~[myproject-0.1.jar!/:na]
    at org.hibernate.jpa.boot.scan.spi.AbstractScannerImpl.scan(AbstractScannerImpl.java:70) ~[myproject-0.1.jar!/:na]
    ... 20 common frames omitted . But I can see my dependency (another jar project) inside `BOOT-INF/lib/`

关注我的pom.xml

<project>    
  ...
  <artifactId>digitalizacao-sender</artifactId>
  ...   
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-activemq</artifactId>
      <version>1.5.9.RELEASE</version>
    </dependency>
    <dependency>
      <groupId>com.my.organization</groupId>
      <artifactId>myproject</artifactId>   <--- my dependency
      <version>1.0</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>repackage</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

任何人都有一个想法,为什么我无法运行java -jar

0 个答案:

没有答案