maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdca...@apache.org
Subject svn commit: r692485 - in /maven/components/branches/maven-2.1.0-M1-RC: maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java maven-project/src/main/java/org/apache/maven/project/MavenProject.java
Date Fri, 05 Sep 2008 16:42:54 GMT
Author: jdcasey
Date: Fri Sep  5 09:42:53 2008
New Revision: 692485

URL: http://svn.apache.org/viewvc?rev=692485&view=rev
Log:
[MNG-3743] Address cases where plugin from a lifecycle mapping has configuration in the pluginManagement
section, but not in the plugins section. This is currently being ignored when a forked build
takes place. Integration test is still in the mix, but I've seen this code change work on
a real project using the compiler and javadoc plugins to trigger the effect, so it *should*
be fixed.

Modified:
    maven/components/branches/maven-2.1.0-M1-RC/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
    maven/components/branches/maven-2.1.0-M1-RC/maven-project/src/main/java/org/apache/maven/project/MavenProject.java

Modified: maven/components/branches/maven-2.1.0-M1-RC/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1.0-M1-RC/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java?rev=692485&r1=692484&r2=692485&view=diff
==============================================================================
--- maven/components/branches/maven-2.1.0-M1-RC/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
(original)
+++ maven/components/branches/maven-2.1.0-M1-RC/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
Fri Sep  5 09:42:53 2008
@@ -144,7 +144,7 @@
     {
         if ( lookupKey == null )
         {
-            lookupKey = groupId + ":" + artifactId.intern();
+            lookupKey = ( groupId + ":" + artifactId ).intern();
         }
         
         return lookupKey;

Modified: maven/components/branches/maven-2.1.0-M1-RC/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1.0-M1-RC/maven-project/src/main/java/org/apache/maven/project/MavenProject.java?rev=692485&r1=692484&r2=692485&view=diff
==============================================================================
--- maven/components/branches/maven-2.1.0-M1-RC/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
(original)
+++ maven/components/branches/maven-2.1.0-M1-RC/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
Fri Sep  5 09:42:53 2008
@@ -1433,6 +1433,37 @@
                 }
             }
         }
+        
+        PluginManagement pluginManagement = getBuild().getPluginManagement();
+        if ( pluginManagement != null && pluginManagement.getPlugins() != null )
+        {
+            for ( Iterator iterator = pluginManagement.getPlugins().iterator(); iterator.hasNext();
)
+            {
+                Plugin plugin = (Plugin) iterator.next();
+
+                if ( pluginGroupId.equals( plugin.getGroupId() ) && pluginArtifactId.equals(
plugin.getArtifactId() ) )
+                {
+                    Xpp3Dom managedDom = (Xpp3Dom) plugin.getConfiguration();
+
+                    if ( executionId != null )
+                    {
+                        PluginExecution execution = (PluginExecution) plugin.getExecutionsAsMap().get(
executionId );
+                        if ( execution != null )
+                        {
+                            Xpp3Dom executionConfiguration = (Xpp3Dom) execution.getConfiguration();
+                            if ( executionConfiguration != null )
+                            {
+                                Xpp3Dom newDom = new Xpp3Dom( executionConfiguration );
+                                managedDom = Xpp3Dom.mergeXpp3Dom( newDom, dom );
+                            }
+                        }
+                    }
+                    
+                    dom = Xpp3Dom.mergeXpp3Dom( dom, managedDom );
+                    break;
+                }
+            }
+        }
 
         if ( dom != null )
         {



Mime
View raw message