You should be able to put all this into a parent pom. Use variables for the
items that vary and then simply override the variables in the implementation
pom files.

On Wed, Jan 12, 2011 at 9:37 AM, alanhay <[email protected]> wrote:

>
> I have something like the following to generate two WARs during the install
> phase, with resources filtered differently for each WAR war_name_UK.war,
> war_name_SP.war.
>
> Everything works as expected however there is obviously a lot of
> duplication
> (in some POMs I have to generate 5 different WARs) and all that differs
> between the <execution/> blocks is the ID, classifer and filtered file
> names
> UK or SP.
>
> Is there a cleaner way to do this?
>
> Generates two WAR files one suffixed _UK and one _SP:
>
> ===========================================
>
> <plugin>
>        <artifactId>maven-war-plugin</artifactId>
>        <version>2.1.1</version>
>        <configuration>
>                 <classifier>UK</classifier>
>                 <warSourceExcludes>**/*web.xml</warSourceExcludes>
>                 <filters>
>
> <filter>${project.basedir}/build_properties/uk.build.properties</filter>
>                 </filters>
>                 <webResources>
>                          <resource>
>                                   <directory>src/main/filtered</directory>
>                                   <filtering>true</filtering>
>                                   <targetPath>WEB-INF</targetPath>
>                          </resource>
>                          <resource>
>                                   <directory>src/main/config</directory>
>                                   <targetPath>WEB-INF/config</targetPath>
>                                   <filtering>false</filtering>
>                          </resource>
>                 </webResources>
>        </configuration>
>
>        <executions>
>                 <execution>
>                          <id>SP</id>
>                          <configuration>
>                                   <classifier>SP</classifier>
>
> <warSourceExcludes>**/*web.xml</warSourceExcludes>
>                                   <filters>
>
> <filter>${project.basedir}/build_properties/sp.build.properties</filter>
>                                   </filters>
>                                   <webResources>
>                                                <resource>
>
> <directory>src/main/filtered</directory>
>
> <filtering>true</filtering>
>
> <targetPath>WEB-INF</targetPath>
>                                                </resource>
>                                                <resource>
>
> <directory>src/main/config</directory>
>
> <targetPath>WEB-INF/config</targetPath>
>
> <filtering>false</filtering>
>                                                </resource>
>                                   </webResources>
>                          </configuration>
>                          <goals>
>                                   <goal>war</goal>
>                          </goals>
>                 </execution>
>        </executions>
> </plugin>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Plugin-Execution-Config-Remove-Duplication-tp3338224p3338224.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to