I'm trying to get Maven to perform several executions with the WAR plugin. It works fine as long as it's defined in the following way:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>1.0</version>
<configuration>
(...)
</configuration>
But not in the following manner
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
(...)
</configuration>
</execution>
</executions>
</plugin>
Where Maven can't find any of the resources I defined in the <configuration>
tag. Have I missed anything important, and/or is there a better way of constructing multiple WAR files in a single build?
Best Answer
I didn't see how to turn off the war that's generated by default, but you can use one configuration outside the
<executions>
element and the rest inside:For me, this builds
artifact-0.1-with-junk.war
andartifact-0.1-with-other-junk.war
and both have the correct files included.