maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1337351 - in /maven/plugin-tools/branches/MPLUGIN-189: maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/ maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/src/main/java/org/apache/maven/plugin/coreit/ maven-p...
Date Fri, 11 May 2012 20:02:08 GMT
Author: olamy
Date: Fri May 11 20:02:08 2012
New Revision: 1337351

URL: http://svn.apache.org/viewvc?rev=1337351&view=rev
Log:
fix mvn 2 compatibility

Modified:
    maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/pom.xml
    maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java
    maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/verify.groovy
    maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java
    maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/pom.xml
    maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/verify.groovy
    maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance/pom.xml
    maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java
    maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance/verify.groovy
    maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/help-basic/pom.xml
    maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/help-package/pom.xml
    maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/java-basic-annotations/pom.xml
    maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-tools-annotations/src/main/resources/META-INF/plexus/components.xml
    maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java

Modified: maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/pom.xml?rev=1337351&r1=1337350&r2=1337351&view=diff
==============================================================================
--- maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/pom.xml
(original)
+++ maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/pom.xml
Fri May 11 20:02:08 2012
@@ -87,6 +87,15 @@ under the License.
   </dependencies>
 
   <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>2.4</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>

Modified: maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java?rev=1337351&r1=1337350&r2=1337351&view=diff
==============================================================================
--- maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java
(original)
+++ maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java
Fri May 11 20:02:08 2012
@@ -45,7 +45,7 @@ public class FirstMojo
     @Parameter( alias = "alias" )
     private String aliasedParam;
 
-    @Component( role = "org.apache.maven.project.MavenProjectHelper", roleHint = "default"
)
+    @Component( role = "org.apache.maven.project.MavenProjectHelper" )// , roleHint = "default"
     private Object projectHelper;
 
     public void execute()

Modified: maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/verify.groovy?rev=1337351&r1=1337350&r2=1337351&view=diff
==============================================================================
--- maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/verify.groovy
(original)
+++ maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/verify.groovy
Fri May 11 20:02:08 2012
@@ -43,7 +43,7 @@ assert mojo.requirements.requirement[1].
 assert mojo.requirements.requirement[1].'field-name'.text() == 'compilerManager'
 
 assert mojo.requirements.requirement[2].role.text() == 'org.apache.maven.project.MavenProjectHelper'
-assert mojo.requirements.requirement[2].'role-hint'.text() == 'default'
+//assert mojo.requirements.requirement[2].'role-hint'.text() == 'default'
 assert mojo.requirements.requirement[2].'field-name'.text() == 'projectHelper'
 
 assert mojo.parameters.parameter.size() == 3

Modified: maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java?rev=1337351&r1=1337350&r2=1337351&view=diff
==============================================================================
--- maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java
(original)
+++ maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java
Fri May 11 20:02:08 2012
@@ -46,7 +46,7 @@ public class FirstMojo
     @Parameter( alias = "alias" )
     private String aliasedParam;
 
-    @Component( role = "org.apache.maven.project.MavenProjectHelper", roleHint = "default"
)
+    @Component( role = "org.apache.maven.project.MavenProjectHelper")
     private Object projectHelper;
 
     public void execute()

Modified: maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/pom.xml?rev=1337351&r1=1337350&r2=1337351&view=diff
==============================================================================
--- maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/pom.xml
(original)
+++ maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/pom.xml
Fri May 11 20:02:08 2012
@@ -85,4 +85,16 @@ under the License.
     </dependency>
   </dependencies>
 
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>2.4</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
 </project>

Modified: maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/verify.groovy?rev=1337351&r1=1337350&r2=1337351&view=diff
==============================================================================
--- maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/verify.groovy
(original)
+++ maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/verify.groovy
Fri May 11 20:02:08 2012
@@ -37,7 +37,7 @@ assert mojo.configuration.touchFile[0].'
 assert mojo.requirements.requirement.size() == 3
 
 assert mojo.requirements.requirement[2].role.text() == 'org.apache.maven.project.MavenProjectHelper'
-assert mojo.requirements.requirement[2].'role-hint'.text() == 'default'
+//assert mojo.requirements.requirement[2].'role-hint'.text() == 'default'
 assert mojo.requirements.requirement[2].'field-name'.text() == 'projectHelper'
 
 assert mojo.parameters.parameter.size() == 3

Modified: maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance/pom.xml?rev=1337351&r1=1337350&r2=1337351&view=diff
==============================================================================
--- maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance/pom.xml
(original)
+++ maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance/pom.xml
Fri May 11 20:02:08 2012
@@ -81,6 +81,15 @@ under the License.
   </dependencies>
 
   <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>2.4</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>

Modified: maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java?rev=1337351&r1=1337350&r2=1337351&view=diff
==============================================================================
--- maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java
(original)
+++ maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java
Fri May 11 20:02:08 2012
@@ -45,7 +45,7 @@ public class FirstMojo
     @Parameter( alias = "alias" )
     private String aliasedParam;
 
-    @Component( role = "org.apache.maven.project.MavenProjectHelper", roleHint = "default"
)
+    @Component( role = "org.apache.maven.project.MavenProjectHelper" )//, roleHint = "default"
     private Object projectHelper;
 
     public void execute()

Modified: maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance/verify.groovy?rev=1337351&r1=1337350&r2=1337351&view=diff
==============================================================================
--- maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance/verify.groovy
(original)
+++ maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/annotation-with-inheritance/verify.groovy
Fri May 11 20:02:08 2012
@@ -41,7 +41,7 @@ assert mojo.configuration.touchFile[0].'
 assert mojo.requirements.requirement.size() == 3
 
 assert mojo.requirements.requirement[2].role.text() == 'org.apache.maven.project.MavenProjectHelper'
-assert mojo.requirements.requirement[2].'role-hint'.text() == 'default'
+//assert mojo.requirements.requirement[2].'role-hint'.text() == 'default'
 assert mojo.requirements.requirement[2].'field-name'.text() == 'projectHelper'
 
 assert mojo.parameters.parameter.size() == 3

Modified: maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/help-basic/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/help-basic/pom.xml?rev=1337351&r1=1337350&r2=1337351&view=diff
==============================================================================
--- maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/help-basic/pom.xml
(original)
+++ maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/help-basic/pom.xml
Fri May 11 20:02:08 2012
@@ -50,6 +50,15 @@ under the License.
   </dependencies>
 
   <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>2.4</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>

Modified: maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/help-package/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/help-package/pom.xml?rev=1337351&r1=1337350&r2=1337351&view=diff
==============================================================================
--- maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/help-package/pom.xml
(original)
+++ maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/help-package/pom.xml
Fri May 11 20:02:08 2012
@@ -50,6 +50,15 @@ under the License.
   </dependencies>
 
   <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>2.4</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>

Modified: maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/java-basic-annotations/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/java-basic-annotations/pom.xml?rev=1337351&r1=1337350&r2=1337351&view=diff
==============================================================================
--- maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/java-basic-annotations/pom.xml
(original)
+++ maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-plugin/src/it/java-basic-annotations/pom.xml
Fri May 11 20:02:08 2012
@@ -58,6 +58,15 @@ under the License.
   </dependencies>
 
   <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>2.4</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>

Modified: maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-tools-annotations/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-tools-annotations/src/main/resources/META-INF/plexus/components.xml?rev=1337351&r1=1337350&r2=1337351&view=diff
==============================================================================
--- maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-tools-annotations/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-tools-annotations/src/main/resources/META-INF/plexus/components.xml
Fri May 11 20:02:08 2012
@@ -33,19 +33,15 @@
       <requirements>
         <requirement>
           <role>org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotationsScanner</role>
-          <role-hint>default</role-hint>
         </requirement>
         <requirement>
           <role>org.apache.maven.artifact.resolver.ArtifactResolver</role>
-          <role-hint>default</role-hint>
         </requirement>
         <requirement>
           <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
-          <role-hint>default</role-hint>
         </requirement>
         <requirement>
           <role>org.codehaus.plexus.archiver.manager.ArchiverManager</role>
-          <role-hint>default</role-hint>
         </requirement>
       </requirements>
     </component>

Modified: maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java?rev=1337351&r1=1337350&r2=1337351&view=diff
==============================================================================
--- maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java
(original)
+++ maven/plugin-tools/branches/MPLUGIN-189/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java
Fri May 11 20:02:08 2012
@@ -42,6 +42,7 @@ import java.io.StringWriter;
 import java.io.Writer;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
@@ -103,26 +104,27 @@ public class PluginHelpGenerator
 
         MojoDescriptor helpDescriptor = makeHelpDescriptor( pluginDescriptor );
 
-        // Verify that no help goal already exists
-        for ( @SuppressWarnings( "unchecked" ) Iterator<MojoDescriptor> it = pluginDescriptor.getMojos().iterator();
-              it.hasNext(); )
-        {
-            MojoDescriptor descriptor = it.next();
+        List<MojoDescriptor> mojoDescriptors = pluginDescriptor.getMojos();
 
-            if ( descriptor.getGoal().equals( helpDescriptor.getGoal() ) && !descriptor.getImplementation().equals(
-                helpDescriptor.getImplementation() ) )
+        if ( mojoDescriptors != null )
+        {
+            // Verify that no help goal already exists
+            for ( MojoDescriptor descriptor : mojoDescriptors )
             {
-                if ( getLogger().isWarnEnabled() )
+                if ( descriptor.getGoal().equals( helpDescriptor.getGoal() ) && !descriptor.getImplementation().equals(
+                    helpDescriptor.getImplementation() ) )
                 {
-                    getLogger().warn( "\n\nA help goal (" + descriptor.getImplementation()
-                                          + ") already exists in this plugin. SKIPPED THE
"
-                                          + helpDescriptor.getImplementation() + " GENERATION.\n"
);
-                }
+                    if ( getLogger().isWarnEnabled() )
+                    {
+                        getLogger().warn( "\n\nA help goal (" + descriptor.getImplementation()
+                                              + ") already exists in this plugin. SKIPPED
THE "
+                                              + helpDescriptor.getImplementation() + " GENERATION.\n"
);
+                    }
 
-                return;
+                    return;
+                }
             }
         }
-
         Properties properties = new Properties();
         properties.put( "helpPackageName", helpPackageName == null ? "" : helpPackageName
);
 
@@ -316,9 +318,13 @@ public class PluginHelpGenerator
     protected static String discoverPackageName( PluginDescriptor pluginDescriptor )
     {
         Map<String, Integer> packageNames = new HashMap<String, Integer>();
-        for ( Iterator it = pluginDescriptor.getMojos().iterator(); it.hasNext(); )
+        List<MojoDescriptor> mojoDescriptors = pluginDescriptor.getMojos();
+        if ( mojoDescriptors == null )
+        {
+            return "";
+        }
+        for ( MojoDescriptor descriptor : mojoDescriptors )
         {
-            MojoDescriptor descriptor = (MojoDescriptor) it.next();
 
             String impl = descriptor.getImplementation();
             if ( StringUtils.equals( descriptor.getGoal(), "help" ) && StringUtils.equals(
"HelpMojo", impl ) )



Mime
View raw message