Maven 2 & 3

<pluginManagement><dependencies> is not propagated to child POMs

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0.3
  • Component/s: POM
  • Labels:
    None
  • Complexity:
    Intermediate
  • Number of attachments :
    1

Description

<executions> section in <pluginManagement> isn't propagated to child POMs (as <configuration> is).
The workaround is to use <plugins> with <inherited>true</inherited>
Is this on purpose ?

Issue Links

Activity

Hide
Edwin Punzalan added a comment -

Hi. The patch in MNG-1499 released with 2.0.1 could have fixed this.... I tried it on my machine and found the executions to be inherited.

Can you try using 2.0.1 and see if its fixed?

Show
Edwin Punzalan added a comment - Hi. The patch in MNG-1499 released with 2.0.1 could have fixed this.... I tried it on my machine and found the executions to be inherited. Can you try using 2.0.1 and see if its fixed?
Hide
Yann Le Du added a comment -

I tried with a brand new Maven 2.0.1 installation and got the same thing.

What I'm trying to do is to run an Ant script at process-resources phase. Currently, I use the following conf. Moving it to pluginManagement would allow it not to be executed also for the parent.

<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<ant antfile="replace.xml"/>
</tasks>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-nodeps</artifactId>
<version>1.6.5</version>
</dependency>
</dependencies>
<inherited>true</inherited>
</plugin>
</plugins>

Show
Yann Le Du added a comment - I tried with a brand new Maven 2.0.1 installation and got the same thing. What I'm trying to do is to run an Ant script at process-resources phase. Currently, I use the following conf. Moving it to pluginManagement would allow it not to be executed also for the parent. <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>process-resources</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> <ant antfile="replace.xml"/> </tasks> </configuration> </execution> </executions> <dependencies> <dependency> <groupId>ant</groupId> <artifactId>ant-nodeps</artifactId> <version>1.6.5</version> </dependency> </dependencies> <inherited>true</inherited> </plugin> </plugins>
Hide
Edwin Punzalan added a comment -

Hmmm... that's odd. can you do a "mvn help:effective-pom" on the child module and see which have been inherited? Mine definitely has the executions inherited.

Show
Edwin Punzalan added a comment - Hmmm... that's odd. can you do a "mvn help:effective-pom" on the child module and see which have been inherited? Mine definitely has the executions inherited.
Hide
Edwin Punzalan added a comment -

Hi, can you provide some more info on how to reproduce this? Or maybe if there are others who have the same problem under 2.0.1, please do so too. Because I am unable to reproduce the error and would likely close this issue as "Cannot Repoduce". Thanks.

Show
Edwin Punzalan added a comment - Hi, can you provide some more info on how to reproduce this? Or maybe if there are others who have the same problem under 2.0.1, please do so too. Because I am unable to reproduce the error and would likely close this issue as "Cannot Repoduce". Thanks.
Hide
Yann Le Du added a comment -

Hi Edwin, sorry, I wanted to post yesterday, but JIRA was down.
You were right, <executions> is inherited. Yet, <dependencies> is not, hence my test failure.
Should I close this issue and create another one for <dependencies> ?

mvn help:effective-pom gives :
~ <pluginManagement>
~ <plugins>
~ <plugin>
~ <artifactId>maven-antrun-plugin</artifactId>
~ <executions>
~ <execution>
~ <phase>process-resources</phase>
~ <goals>
~ <goal>run</goal>
~ </goals>
~ <configuration>
~ <tasks>
~ <ant antfile="replace.xml"></ant>
~ </tasks>
~ </configuration>
~ </execution>
~ </executions>
~ <dependencies>
~ <dependency>
~ <groupId>ant</groupId>
~ <artifactId>ant-nodeps</artifactId>
~ <version>1.6.5</version>
~ </dependency>
~ </dependencies>
~ </plugin>
~ </plugins>
~ </pluginManagement>
~ <plugins>
~ <plugin>
~ <artifactId>maven-antrun-plugin</artifactId>
~ <executions>
~ <execution>
~ <phase>process-resources</phase>
~ <goals>
~ <goal>run</goal>
~ </goals>
~ <configuration>
~ <tasks>
~ <ant antfile="replace.xml"></ant>
~ </tasks>
~ </configuration>
~ </execution>
~ </executions>
~ </plugin>

Show
Yann Le Du added a comment - Hi Edwin, sorry, I wanted to post yesterday, but JIRA was down. You were right, <executions> is inherited. Yet, <dependencies> is not, hence my test failure. Should I close this issue and create another one for <dependencies> ? mvn help:effective-pom gives : ~ <pluginManagement> ~ <plugins> ~ <plugin> ~ <artifactId>maven-antrun-plugin</artifactId> ~ <executions> ~ <execution> ~ <phase>process-resources</phase> ~ <goals> ~ <goal>run</goal> ~ </goals> ~ <configuration> ~ <tasks> ~ <ant antfile="replace.xml"></ant> ~ </tasks> ~ </configuration> ~ </execution> ~ </executions> ~ <dependencies> ~ <dependency> ~ <groupId>ant</groupId> ~ <artifactId>ant-nodeps</artifactId> ~ <version>1.6.5</version> ~ </dependency> ~ </dependencies> ~ </plugin> ~ </plugins> ~ </pluginManagement> ~ <plugins> ~ <plugin> ~ <artifactId>maven-antrun-plugin</artifactId> ~ <executions> ~ <execution> ~ <phase>process-resources</phase> ~ <goals> ~ <goal>run</goal> ~ </goals> ~ <configuration> ~ <tasks> ~ <ant antfile="replace.xml"></ant> ~ </tasks> ~ </configuration> ~ </execution> ~ </executions> ~ </plugin>
Hide
Brett Porter added a comment -

I've updated the subject accordingly.

Show
Brett Porter added a comment - I've updated the subject accordingly.
Hide
Grégory Joseph added a comment -

then this is duplicate with MNG-1896

Show
Grégory Joseph added a comment - then this is duplicate with MNG-1896
Hide
Edwin Punzalan added a comment -

Attached patch with unit test

I forgot that this is still assigned to me _

Show
Edwin Punzalan added a comment - Attached patch with unit test I forgot that this is still assigned to me _

People

Vote (2)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: