When I run APP springBoot using IDE or mvn spring-boot:run
it works fine, but when I execute the command below it does not work:
java -jar myapp.jar
Show an error like this:
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/'
A portion of pom.xml
follows:
<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>