2014-04-03 62 views
0

我使用Maven 2.2.1和JDK 1.7.0_51,我将一些jar文件重新打包到一个jar中。Maven添加-generic到我的jar名称

我有一个问题,其中maven-assembly-plugin正在向我创建的jar的名称添加-generic。输出是xxxxLib-4.2.11-generic.jar,我希望它是xxxxLib-4.2.11.jar

<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> 

回答

0

我已经找到了针对这个问题的解决方案,我已经在描述符标签上面添加了以下代码,并且现在已经停止了将泛型标记添加到jar中,如我所愿。

<appendAssemblyId>false</appendAssemblyId> 
    <finalName>${project.name}-${project.version}</finalName> 
相关问题