maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Wheeler <rwhee...@artifact-software.com>
Subject Re: Plugin executions vs. POM inheritance
Date Tue, 02 Feb 2010 23:20:14 GMT
I am not sure what you are trying to do but I am wondering if you can 
build several parent POMs and set up each POM have the parent that suits 
its needs.

I am not sure how many combinations you need but AFAIK there is no need 
for each child to have the same parent.

Ron

Andreas Sewe wrote:
> Hi Stephen,
>
> I am in a situation similar to the OP's, so your reply made me 
> refactor my POMs. (Its never to late to get rid of a little 
> copy-n-paste :-)
>
> But unfortunately I couldn't get your proposal to work. Here's the 
> execution I configured in my parent POM, which I want to reuse in 
> *some* of my child POMs:
>
> <pluginManagement>
> <plugins>
> <plugin>
> <artifactId>maven-failsafe-plugin</artifactId>
> <version>2.5</version>
> <!-- Thrown in for good measure; I suspect I only need the 
> execution-level inherited -->
> <inherited>false</inherited>
> <executions>
> <execution>
> <id>integration-test-with-foo</id>
> <inherited>false</inherited>
> <goals>
> <goal>integration-test</goal>
> <goal>verify</goal>
> </goals>
> <configuration>
> <argLine>FOO</argLine>
> </configuration>
> </execution>
> </executions>
> </plugin>
> <plugins>
> </pluginManagement>
>
> Due to the use of <pluginManagement> instead of a plain <plugins> the 
> parent POM itself does not use this execution (as desired).
>
> Now, calling the "integration-test-with-foo" execution from a child 
> POM also works fine:
>
> <plugins>
> <plugin>
> <artifactId>maven-failsafe-plugin</artifactId>
> <executions>
> <execution>
> <id>integration-test-with-foo</id>
> </execution>
> </executions>
> </plugin>
> <plugins>
>
> But even if I don't call it at all from one of my child POMs, but 
> rather use a different plugin execution, "integration-test-with-foo" 
> still gets executed (along with "integration-test-with-bar"):
>
> <plugins>
> <plugin>
> <artifactId>maven-failsafe-plugin</artifactId>
> <executions>
> <execution>
> <id>integration-test-with-bar</id>
> <goals>
> <goal>integration-test</goal>
> <goal>verify</goal>
> </goals>
> <configuration>
> <argLine>BAR</argLine>
> </configuration>
> </execution>
> </executions>
> </plugin>
> <plugins>
>
> And that's something I don't understand. Isn't 
> <inherited>false</inherited> supposed to prevent this? (FWIW, this 
> happens using either Maven 2.2.0 or a recent 3.0-SNAPSHOT, so I 
> suppose its a bug in my understanding of <inherited> rather than in 
> Maven's.)
>
> Best wishes,
>
> Andreas Sewe
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message