Maven plug Packing: dependencies packaged lib packaged in a jar dependencies

<! - packing plug, jar dependencies and separate packages, packed into the lib dependencies viable test -> 
<plugin>
<the groupId> org.apache.maven.plugins </ the groupId>
<the artifactId> JAR-Maven-plugin </ the artifactId>
<Version> 2.6 </ Version>
<Configuration>
<Archive>
<the manifest>
<addClassPath> to true </ addClassPath>
<classpathPrefix> lib / </ classpathPrefix>
<mainClass> com.xxx.xxxService </ mainClass>
</ the manifest>
</ Archive>
</ Configuration>
</ plugin>
<plugin>
<the groupId> org.apache.maven.plugins </ the groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

<!--打包,把依赖包打包到jar内 测试OK-->
<!--<plugin>-->
<!--<artifactId>maven-assembly-plugin</artifactId>-->
<!--<configuration>-->
<!--<descriptorRefs>-->
<!--<descriptorRef>jar-with-dependencies</descriptorRef>-->
<!--</descriptorRefs>-->
<!--<archive>-->
<!--<manifest>-->
<!--<mainClass>com.xxx.xxxService</mainClass>-->
<!--</manifest>-->
<!--</archive>-->
<!--</configuration>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>make-assembly</id>-->
<!--<phase>package</phase>-->
<!--<goals>-->
<!--<goal>single</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->

Guess you like

Origin www.cnblogs.com/ranran-liang123/p/11274189.html