You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by st...@apache.org on 2011/06/09 10:29:00 UTC
svn commit: r1133707 [2/2] - in /maven/plugin-tools/trunk: ./
maven-plugin-plugin/
maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/
maven-plugin-tools-ant/src/main/java/org/apache/maven/tools/plugin/extractor/ant/
maven-plugin-tools-ap...
Modified: maven/plugin-tools/trunk/maven-plugin-tools-model/src/main/java/org/apache/maven/plugin/tools/model/PluginMetadataParser.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-model/src/main/java/org/apache/maven/plugin/tools/model/PluginMetadataParser.java?rev=1133707&r1=1133706&r2=1133707&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-model/src/main/java/org/apache/maven/plugin/tools/model/PluginMetadataParser.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-tools-model/src/main/java/org/apache/maven/plugin/tools/model/PluginMetadataParser.java Thu Jun 9 08:28:59 2011
@@ -19,6 +19,13 @@ package org.apache.maven.plugin.tools.mo
* under the License.
*/
+import java.io.File;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
import org.apache.maven.plugin.descriptor.DuplicateParameterException;
import org.apache.maven.plugin.descriptor.MojoDescriptor;
import org.apache.maven.plugin.descriptor.Parameter;
@@ -29,14 +36,6 @@ import org.codehaus.plexus.util.ReaderFa
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-import java.io.File;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
/**
* Parser for plugin metadata.
*
@@ -53,10 +52,10 @@ public class PluginMetadataParser
* @return a set of <code>MojoDescriptor</code>
* @throws PluginMetadataParseException if any
*/
- public Set parseMojoDescriptors( File metadataFile )
+ public Set<MojoDescriptor> parseMojoDescriptors( File metadataFile )
throws PluginMetadataParseException
{
- Set descriptors = new HashSet();
+ Set<MojoDescriptor> descriptors = new HashSet<MojoDescriptor>();
Reader reader = null;
@@ -68,14 +67,12 @@ public class PluginMetadataParser
PluginMetadata pluginMetadata = metadataReader.read( reader );
- List mojos = pluginMetadata.getMojos();
+ List<Mojo> mojos = pluginMetadata.getMojos();
if ( mojos != null && !mojos.isEmpty() )
{
- for ( Iterator it = mojos.iterator(); it.hasNext(); )
+ for ( Mojo mojo :mojos )
{
- Mojo mojo = (Mojo) it.next();
-
MojoDescriptor descriptor = asDescriptor( metadataFile, mojo );
descriptors.add( descriptor );
@@ -137,15 +134,12 @@ public class PluginMetadataParser
descriptor.setExecutePhase( le.getPhase() );
}
- List parameters = mojo.getParameters();
+ List<org.apache.maven.plugin.tools.model.Parameter> parameters = mojo.getParameters();
if ( parameters != null && !parameters.isEmpty() )
{
- for ( Iterator it = parameters.iterator(); it.hasNext(); )
+ for ( org.apache.maven.plugin.tools.model.Parameter param : parameters )
{
- org.apache.maven.plugin.tools.model.Parameter param =
- (org.apache.maven.plugin.tools.model.Parameter) it.next();
-
Parameter dParam = new Parameter();
dParam.setAlias( param.getAlias() );
dParam.setDeprecated( param.getDeprecation() );
@@ -186,14 +180,12 @@ public class PluginMetadataParser
}
}
- List components = mojo.getComponents();
+ List<Component> components = mojo.getComponents();
if ( components != null && !components.isEmpty() )
{
- for ( Iterator it = components.iterator(); it.hasNext(); )
+ for ( Component component : components )
{
- Component component = (Component) it.next();
-
ComponentRequirement cr = new ComponentRequirement();
cr.setRole( component.getRole() );
cr.setRoleHint( component.getHint() );
Modified: maven/plugin-tools/trunk/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/pom.xml?rev=1133707&r1=1133706&r2=1133707&view=diff
==============================================================================
--- maven/plugin-tools/trunk/pom.xml (original)
+++ maven/plugin-tools/trunk/pom.xml Thu Jun 9 08:28:59 2011
@@ -38,6 +38,13 @@
<description>The Maven Plugin Tools contains the necessary tools to be able to produce Maven Plugins in a variety of languages.</description>
<url>http://maven.apache.org/plugin-tools/</url>
<inceptionYear>2004</inceptionYear>
+
+ <contributors>
+ <contributor>
+ <name>Robert Scholte</name>
+ <timezone>+1</timezone>
+ </contributor>
+ </contributors>
<mailingLists>
<mailingList>
@@ -221,6 +228,20 @@
<pluginManagement>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.8.1</version>
+ </plugin>
+ <plugin>
<artifactId>maven-site-plugin</artifactId>
<version>2.2</version>
<configuration>