我们的pom.xml在maven- jar插件中有多个执行,目的是创建三个单独的jar文件。调用mvn并构建这三个jars的方法是什么?
目前
mvn compile jar:jar仍然只创建一个罐子。
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>UDFCommon</id>
<goals><goal>jar</goal></goals>
<phase>package</phase>
<configuration>
<forceCreation>true</forceCreation>
<classifier>UDFCommon</classifier>
<includes>
<include>**/pafcommon/*</include>
</includes>
</configuration>
</execution>
<execution>
<id>UDFOne</id>
<goals><goal>jar</goal></goals>
<phase>package</phase>
<configuration>
<classifier>UDFOne</classifier>
<includes>
<include>**/dqm/*</include>
</includes>
</configuration>
</execution>
<execution>
<id>UDFTwo</id>
<goals><goal>jar</goal></goals>
<phase>package</phase>
<configuration>
<classifier>UDFTwo</classifier>
<includes>
<include>**/ciview/*</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>发布于 2013-10-16 22:27:12
jar:jar似乎不处理多个jar文件。但跑
mvn compile package就能做到这一点。
-rw-r--r-- 1 steve staff 2629074 Oct 16 15:24 UDFPafDqm.jar
-rw-r--r-- 1 steve staff 13286 Oct 16 15:24 UDFPafDqm-UDFTwo.jar
-rw-r--r-- 1 steve staff 40315 Oct 16 15:24 UDFPafDqm-UDFOne.jar
-rw-r--r-- 1 steve staff 6942 Oct 16 15:24 UDFPafDqm-UDFCommon.jar这需要一个assembly.xml :下面是一个基本的骨架。
<assembly>
<id>job</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.build.outputDirectory}</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<scope>runtime</scope>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
</assembly>https://stackoverflow.com/questions/19414802
复制相似问题