Maven将-generic添加到我的jar名称中
我正在使用Maven 2.2.1和JDK 1.7.0_51,我正在将一些jar文件重新打包到一个jar中 我有一个问题,maven汇编插件在我创建的jar名称中添加了-generic。输出是xxxlib-4.2.11-generic.jar,我希望它是xxxlib-4.2.11.jarMaven将-generic添加到我的jar名称中,jar,maven-2,maven-assembly-plugin,Jar,Maven 2,Maven Assembly Plugin,我正在使用Maven 2.2.1和JDK 1.7.0_51,我正在将一些jar文件重新打包到一个jar中 我有一个问题,maven汇编插件在我创建的jar名称中添加了-generic。输出是xxxlib-4.2.11-generic.jar,我希望它是xxxlib-4.2.11.jar <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>xxxx</groupId>
<artifactId>xxxx-assembly</artifactId>
<version>4.2.11</version>
<name>xxxxLib</name>
<build>
<finalName>${project.name}-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<skipIfEmpty>true</skipIfEmpty>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/assembly/descriptor.xml</descriptor>
</descriptors>
<finalName>${project.name}-${project.version}</finalName>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin> ....
程序集描述符如下所示:
<assembly>
<id>generic</id>
<formats>
<format>jar</format>
</formats>
<baseDirectory>maven</baseDirectory>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.build.directory}/lib</directory>
<outputDirectory></outputDirectory>
</fileSet>
</fileSets>
</assembly>
我已经找到了这个问题的解决方案,我已经在Descriptor标记的上方添加了下面的代码,现在已经停止了向jar添加我想要的通用标记
<appendAssemblyId>false</appendAssemblyId>
<finalName>${project.name}-${project.version}</finalName>