Reputation: 1541
I am moving my maven build from 2.2-beta5 to 2.2. As per documentation assembly:assembly is deprecated and I am trying to replace it by assembly:single. I have been trying various configuration but it is still not working I usualy get the follwoing error: Error reading assemblies: No assembly descriptors found.
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>assembly</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${env}.${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<filters>
<filter>src/main/filters/${env}/${build.env}/filter-common.properties</filter>
<filter>src/main/filters/${env}/${build.env}/filter-${user.name}.properties</filter>
</filters>
<descriptors>
<descriptor>src/main/assembly/distribution.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
Executed with : mvn clean package assembly:single install antrun:run
I have also tried moving the configuration out of the execution tag but this causes the same problem. When removing assembly:single from the command the plugin i snot executed. Pleae let me know what is the corect way of executing this plugin ?
Many Thanks
Upvotes: 4
Views: 14021
Reputation: 1541
After some trial and error I notice that by adding this to the package phase, it will work just fine:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${env}.${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<filters>
<filter>src/main/filters/${env}/${build.env}/filter-common.properties</filter>
<filter>src/main/filters/${env}/${build.env}/filter-${user.name}.properties</filter>
</filters>
<descriptors>
<descriptor>src/main/assembly/distribution.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
Upvotes: 3