user2961454
user2961454

Reputation: 353

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

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>

Upvotes: 8

Views: 7138

Answers (1)

Santanu Dey
Santanu Dey

Reputation: 2978

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>

Upvotes: 24

Related Questions