Maven executable Jar throws error on start
This question already has an answer here:
If I'm correct, maven-jar-plugin creates a jar with all the compiled .class files, but without the dependencies.
I'd recommend using maven-assembly-plugin and binding it to the package execution phase, that way it would be built when running mvn install
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.pwc.scfa.pensareautomatio3.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
See this answer for more information.
链接地址: http://www.djcxy.com/p/29630.html上一篇: 可执行jar与依赖使用maven