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: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to