Assembly ID is getting appended when zip file is created by maven

6.5k views Asked by At

xml and pom.xml which creates jar file and then zip file with some artifacts including jar file. But when i run maven install zip file is getting created as GenerateMissingUsersReport-bin.zip instead I want it to create as GenerateMissingUsersReport.zip. I have set as false. But no difference.

Any pointers?

Here is dep.xml

<id>bin</id>  
<baseDirectory>../</baseDirectory>  
<formats>  
<format>zip</format>  
</formats>  
<fileSets>  
<fileSet>  
<directory>${project.basedir}</directory>  
<outputDirectory>/</outputDirectory>  
<includes>  
<include>README*</include>  
<include>LICENSE*</include>  
<include>NOTICE*</include>  
</includes>  
</fileSet>  
<fileSet>  
<directory>${project.build.directory}</directory>  
<outputDirectory>/lib</outputDirectory>  
<includes>  
<include>*.jar</include>  
</includes>  
</fileSet>  
<fileSet>  
<directory>${project.build.directory}/classes</directory>  
<includes>  
<include>plugin.xml</include>  
</includes>   
<outputDirectory>/</outputDirectory>  
</fileSet>  
</fileSets>  

Here is pom.xml

<finalName>GenerateMissingUsersReport</finalName>
    <plugins>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                        <finalName>GenerateMissingUsersReport</finalName>
                        <appendAssemblyID>false</appendAssemblyID>
                        <descriptor>src/assembly/dep.xml</descriptor>
            </configuration>
            <executions>
                <execution>
                    <id>make-zip</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
            </execution>
            </executions>
        </plugin>
        <plugin>
    <artifactId>maven-jar-plugin</artifactId>
    <version>2.4</version>
    <executions>
      <execution>
        <id>default-jar</id>
        <phase>package</phase>
        <goals>
          <goal>jar</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
    <excludes>
    <exclude>plugin.xml</exclude>
    </excludes></configuration>
    </plugin>
1

There are 1 answers

0
Santanu Dey On

Add the following line under configurations element of the pom

<appendAssemblyId>false</appendAssemblyId>

Also make sure you use the latest version of the assembly plugin

<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.5</version>