Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 1.1
-
Fix Version/s: None
-
Labels:None
-
Environment:Linux Fedora Core 5, SUN JDK 1.5
Description
Has parent/child project
parent
child1
in parent's pom.xml, define a "run"
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>e1</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<echo message="ant e1" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
In child,'s pom.xml, define another "run"
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>e2</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<echo message="ant e2" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expect the two declaration to be merged so that during the generate-sources phase for the child I will see
ant e1
ant e2
what happens right now
[INFO] [antrun:run {execution: e1}]
[INFO] Executing tasks
[echo] ant e1
[INFO] Executed tasks
[INFO] [antrun:run {execution: e2}]
[INFO] Executing tasks
[echo] ant e2
[INFO] Executed tasks
[INFO] [antrun:run {execution: e1}]
[INFO] Executing tasks
[echo] ant e1
[INFO] Executed tasks
[INFO] [antrun:run {execution: e2}]
[INFO] Executing tasks
[echo] ant e2
help:effective-pom shows the merged pom at the child with merge but duplicated antrun plugin declaration
...
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>e1</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo message="ant e1"></echo>
</tasks>
</configuration>
</execution>
<execution>
<id>e2</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo message="ant e2"></echo>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>e1</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo message="ant e1"></echo>
</tasks>
</configuration>
</execution>
<execution>
<id>e2</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo message="ant e2"></echo>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
..
Attached please find
. *.zip has a sample parent/child example, you can go to child1 and do
mvn compile
. epom.xml is the output of 'mvn help:effective-pom' for the child project
Issue Links
- duplicates
-
MNG-2237
Inherited plugin executed twice if child pom merges configuration
-
Upon further investigation I don't think this antrun plugin specific. I believe maven is the one which merge the pom's. How do I change this to a Maven jira and not antrun plugin jira?