You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jd...@apache.org on 2005/06/25 02:00:08 UTC

svn commit: r201693 - in /maven/components/trunk: maven-core-it/ maven-core-it/it0029/ maven-core-it/it0029/child-project/ maven-core-it/it0029/child-project/src/ maven-core-it/it0029/child-project/src/main/ maven-core-it/it0029/child-project/src/main/...

Author: jdcasey
Date: Fri Jun 24 17:00:05 2005
New Revision: 201693

URL: http://svn.apache.org/viewcvs?rev=201693&view=rev
Log:
Resolving issue: MNG-522

o Added check for null child pluginManagement section, and setting to parent value if null.
o Added integration test for parent->child pluginManagement inheritance and injection, to prevent regressions.


Added:
    maven/components/trunk/maven-core-it/it0029/
    maven/components/trunk/maven-core-it/it0029/child-project/
    maven/components/trunk/maven-core-it/it0029/child-project/pom.xml   (with props)
    maven/components/trunk/maven-core-it/it0029/child-project/src/
    maven/components/trunk/maven-core-it/it0029/child-project/src/main/
    maven/components/trunk/maven-core-it/it0029/child-project/src/main/java/
    maven/components/trunk/maven-core-it/it0029/child-project/src/main/java/org/
    maven/components/trunk/maven-core-it/it0029/child-project/src/main/java/org/apache/
    maven/components/trunk/maven-core-it/it0029/child-project/src/main/java/org/apache/maven/
    maven/components/trunk/maven-core-it/it0029/child-project/src/main/java/org/apache/maven/it0001/
    maven/components/trunk/maven-core-it/it0029/child-project/src/main/java/org/apache/maven/it0001/Person.java   (with props)
    maven/components/trunk/maven-core-it/it0029/expected-results.txt   (with props)
    maven/components/trunk/maven-core-it/it0029/goals.txt   (with props)
    maven/components/trunk/maven-core-it/it0029/pom.xml   (with props)
    maven/components/trunk/maven-core-it/it0029/prebuild-hook.txt   (with props)
Modified:
    maven/components/trunk/maven-core-it/README.txt
    maven/components/trunk/maven-core-it/integration-tests.txt
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java

Modified: maven/components/trunk/maven-core-it/README.txt
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/README.txt?rev=201693&r1=201692&r2=201693&view=diff
==============================================================================
--- maven/components/trunk/maven-core-it/README.txt (original)
+++ maven/components/trunk/maven-core-it/README.txt Fri Jun 24 17:00:05 2005
@@ -88,6 +88,8 @@
 it0028: Test that unused configuration parameters from the POM don't cause the
         mojo to fail...they will show up as warnings in the -X output instead.
 
+it0029: Test for pluginManagement injection of plugin configuration.
+
 -------------------------------------------------------------------------------
 
 - generated sources

Modified: maven/components/trunk/maven-core-it/integration-tests.txt
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/integration-tests.txt?rev=201693&r1=201692&r2=201693&view=diff
==============================================================================
--- maven/components/trunk/maven-core-it/integration-tests.txt (original)
+++ maven/components/trunk/maven-core-it/integration-tests.txt Fri Jun 24 17:00:05 2005
@@ -1,3 +1,4 @@
+it0029
 it0028
 it0027
 it0026

Added: maven/components/trunk/maven-core-it/it0029/child-project/pom.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0029/child-project/pom.xml?rev=201693&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0029/child-project/pom.xml (added)
+++ maven/components/trunk/maven-core-it/it0029/child-project/pom.xml Fri Jun 24 17:00:05 2005
@@ -0,0 +1,29 @@
+<model>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.maven.it</groupId>
+    <artifactId>maven-core-it0030</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <groupId>org.apache.maven.it</groupId>
+  <artifactId>maven-core-it0030-child</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <type>jar</type>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+      </plugin>
+    </plugins>
+  </build>
+</model>

Propchange: maven/components/trunk/maven-core-it/it0029/child-project/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it0029/child-project/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-core-it/it0029/child-project/src/main/java/org/apache/maven/it0001/Person.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0029/child-project/src/main/java/org/apache/maven/it0001/Person.java?rev=201693&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0029/child-project/src/main/java/org/apache/maven/it0001/Person.java (added)
+++ maven/components/trunk/maven-core-it/it0029/child-project/src/main/java/org/apache/maven/it0001/Person.java Fri Jun 24 17:00:05 2005
@@ -0,0 +1,18 @@
+package org.apache.maven.it0001;
+
+public class Person
+{
+    private String name;
+
+    public void setName( String newName )
+    {
+        assert true;
+
+        this.name = newName;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+}

Propchange: maven/components/trunk/maven-core-it/it0029/child-project/src/main/java/org/apache/maven/it0001/Person.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it0029/child-project/src/main/java/org/apache/maven/it0001/Person.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-core-it/it0029/expected-results.txt
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0029/expected-results.txt?rev=201693&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0029/expected-results.txt (added)
+++ maven/components/trunk/maven-core-it/it0029/expected-results.txt Fri Jun 24 17:00:05 2005
@@ -0,0 +1 @@
+child-project/target/classes/org/apache/maven/it0001/Person.class

Propchange: maven/components/trunk/maven-core-it/it0029/expected-results.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it0029/expected-results.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-core-it/it0029/goals.txt
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0029/goals.txt?rev=201693&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0029/goals.txt (added)
+++ maven/components/trunk/maven-core-it/it0029/goals.txt Fri Jun 24 17:00:05 2005
@@ -0,0 +1 @@
+install

Propchange: maven/components/trunk/maven-core-it/it0029/goals.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it0029/goals.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-core-it/it0029/pom.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0029/pom.xml?rev=201693&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0029/pom.xml (added)
+++ maven/components/trunk/maven-core-it/it0029/pom.xml Fri Jun 24 17:00:05 2005
@@ -0,0 +1,38 @@
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.it</groupId>
+  <artifactId>maven-core-it0030</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <modules>
+    <module>child-project</module>
+  </modules>
+
+  <build>
+    <!-- plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+
+        <configuration>
+          <source>1.4</source>
+          <target>1.4</target>
+        </configuration>
+      </plugin>
+    </plugins -->
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+
+          <configuration>
+            <source>1.4</source>
+            <target>1.4</target>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>

Propchange: maven/components/trunk/maven-core-it/it0029/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it0029/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-core-it/it0029/prebuild-hook.txt
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0029/prebuild-hook.txt?rev=201693&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0029/prebuild-hook.txt (added)
+++ maven/components/trunk/maven-core-it/it0029/prebuild-hook.txt Fri Jun 24 17:00:05 2005
@@ -0,0 +1,2 @@
+rm ${artifact:org.apache.maven.it:maven-core-it0029:1.0-SNAPSHOT:jar}
+rm ${artifact:org.apache.maven.it:maven-core-it0029-child:1.0-SNAPSHOT:jar}

Propchange: maven/components/trunk/maven-core-it/it0029/prebuild-hook.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it0029/prebuild-hook.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java?rev=201693&r1=201692&r2=201693&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java (original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java Fri Jun 24 17:00:05 2005
@@ -23,6 +23,7 @@
 import org.apache.maven.model.DistributionManagement;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.ModelBase;
+import org.apache.maven.model.PluginManagement;
 import org.apache.maven.model.Profile;
 import org.apache.maven.model.ReportPlugin;
 import org.apache.maven.model.ReportSet;
@@ -483,7 +484,17 @@
         // Plugin management :: aggregate
         if ( childBuild != null && parentBuild != null )
         {
-            ModelUtils.mergePluginLists( childBuild.getPluginManagement(), parentBuild.getPluginManagement(), false );
+            PluginManagement childPM = childBuild.getPluginManagement();
+            PluginManagement parentPM = parentBuild.getPluginManagement();
+            
+            if( childPM == null && parentPM !=null )
+            {
+                childBuild.setPluginManagement( parentPM );
+            }
+            else
+            {
+                ModelUtils.mergePluginLists( childBuild.getPluginManagement(), parentBuild.getPluginManagement(), false );
+            }
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org