Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0-alpha-1
-
Fix Version/s: 2.0-alpha-2
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
I have specified a <pluginManagement> section in the parent POM
which is not inherited by the child POM.
The plugin in question is the 'maven-compiler-plugin' which is configured for JDK 1.5 source compatibility.
In the parent POM, this setting is effectuated, but not in the child. When compiling the child, the compiler complains about JDK 1.4+ features in the java source.
A simple test case is attached to reproduce the problem.
The parent POM looks like:
<project>
<name>Parent POM</name>
<groupId>_test</groupId>
<artifactId>parent</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
<module>child</module>
</modules>
<build>
<sourceDirectory>src</sourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>1.0-alpha-2-SNAPSHOT</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
And the child, which inherits from the parent:
The <build> section is overridden with a different <sourceDirectory> and, since the <plugins> of the parent gets lost, it is repeated.
<project>
<name>Child POM</name>
<groupId>_test</groupId>
<artifactId>child</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<parent>
<groupId>_test</groupId>
<artifactId>parent</artifactId>
<version>1.0</version>
</parent>
<build>
<sourceDirectory>src2</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Attachments
Issue Links
| This issue supercedes: | ||||
| MNG-357 | 'build' section of POM does not appears to be inherited |
|
|
|
this was fixed by John's changes, and I have made some additional changes so that a plugin definition is
neverinherited (only plugin management is)neverinherited (only plugin management is)