jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Antrun Plugin
  • MANTRUN-57

merge issue from parent causing executions to be run multiple times

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    antrun-testcase.zip
    08/Aug/06 8:25 PM
    3 kB
    Hung Le
    1. File
      antrun-testcase/child-1/pom.xml~ 1.0 kB
    2. XML File
      antrun-testcase/child-1/pom.xml 0.9 kB
    3. File
      antrun-testcase/pom.xml~ 0.8 kB
    4. XML File
      antrun-testcase/pom.xml 0.8 kB
    Download Zip
    Show
    Zip Archive
    antrun-testcase.zip
    08/Aug/06 8:25 PM
    3 kB
    Hung Le
  2. XML File
    epom.xml
    08/Aug/06 8:25 PM
    6 kB
    Hung Le

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. MNG-2237 Inherited plugin executed twice if child pom merges configuration

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Hung Le added a comment - 10/Aug/06 1:12 PM

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?

Show
Hung Le added a comment - 10/Aug/06 1:12 PM 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?
Hide
Permalink
Kenney Westerhof added a comment - 18/Jul/07 11:08 AM

update fix version since it's not fixed and 1.1 has been released.

Show
Kenney Westerhof added a comment - 18/Jul/07 11:08 AM update fix version since it's not fixed and 1.1 has been released.
Hide
Permalink
Carlos Sanchez added a comment - 15/Jul/08 5:01 PM

seems its a duplicate

Show
Carlos Sanchez added a comment - 15/Jul/08 5:01 PM seems its a duplicate

People

  • Assignee:
    Carlos Sanchez
    Reporter:
    Hung Le
Vote (2)
Watch (0)

Dates

  • Created:
    08/Aug/06 8:25 PM
    Updated:
    15/Jul/08 5:01 PM
    Resolved:
    15/Jul/08 5:01 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.