diff --git a/.gitignore b/.gitignore index 447d3e9..6820817 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ maven-plugin-tools-2.7-source-release.zip /maven-plugin-tools-3.1-source-release.zip /maven-plugin-tools-3.3-source-release.zip /maven-plugin-tools-3.4-source-release.zip +/maven-plugin-tools-3.5-source-release.zip diff --git a/0001-Avoid-duplicate-MOJO-parameters.patch b/0001-Avoid-duplicate-MOJO-parameters.patch index 764137b..4b068d4 100644 --- a/0001-Avoid-duplicate-MOJO-parameters.patch +++ b/0001-Avoid-duplicate-MOJO-parameters.patch @@ -1,4 +1,4 @@ -From 6a2a63169b7b681decc03bfa36a3cbcd22b997b6 Mon Sep 17 00:00:00 2001 +From c3ac93da0ffa924b76c01bd1119e9e5fdf538cb0 Mon Sep 17 00:00:00 2001 From: Michael Simacek Date: Mon, 16 Mar 2015 14:29:21 +0100 Subject: [PATCH 1/3] Avoid duplicate MOJO parameters @@ -8,61 +8,61 @@ Subject: [PATCH 1/3] Avoid duplicate MOJO parameters 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java -index a9c8ccf..7a7e70a 100644 +index 231f623..a034dc2 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java @@ -29,6 +29,7 @@ import java.util.Collection; - import java.util.Collections; - import java.util.HashMap; - import java.util.HashSet; -+import java.util.Iterator; - import java.util.List; - import java.util.Map; - import java.util.Set; + import java.util.Collections; + import java.util.HashMap; + import java.util.HashSet; ++import java.util.Iterator; + import java.util.List; + import java.util.Map; + import java.util.Set; @@ -573,7 +574,7 @@ public class JavaAnnotationsMojoDescriptorExtractor - parameter.setSince( parameterAnnotationContent.getSince() ); - parameter.setRequired( parameterAnnotationContent.required() ); - -- mojoDescriptor.addParameter( parameter ); -+ addParameter( mojoDescriptor, parameter ); - } - - // Component annotations + parameter.setSince( parameterAnnotationContent.getSince() ); + parameter.setRequired( parameterAnnotationContent.required() ); + +- mojoDescriptor.addParameter( parameter ); ++ addParameter( mojoDescriptor, parameter ); + } + + // Component annotations @@ -614,7 +615,7 @@ public class JavaAnnotationsMojoDescriptorExtractor - //parameter.setRequired( ... ); - parameter.setEditable( false ); - -- mojoDescriptor.addParameter( parameter ); -+ addParameter( mojoDescriptor, parameter ); - } - - mojoDescriptor.setPluginDescriptor( pluginDescriptor ); + //parameter.setRequired( ... ); + parameter.setEditable( false ); + +- mojoDescriptor.addParameter( parameter ); ++ addParameter( mojoDescriptor, parameter ); + } + + mojoDescriptor.setPluginDescriptor( pluginDescriptor ); @@ -624,6 +625,25 @@ public class JavaAnnotationsMojoDescriptorExtractor - return mojoDescriptors; - } - -+ private void addParameter( ExtendedMojoDescriptor mojoDescriptor, -+ org.apache.maven.plugin.descriptor.Parameter parameter ) -+ throws DuplicateParameterException -+ { -+ if ( mojoDescriptor.getParameters() != null ) -+ { -+ for ( Iterator it = mojoDescriptor.getParameters().iterator(); it.hasNext(); ) -+ { -+ if ( it.next().equals( parameter ) ) -+ { -+ getLogger().warn( "Duplicate parameter " + parameter.getName() + " field in MOJO descriptor" ); -+ it.remove(); -+ } -+ } -+ } -+ -+ mojoDescriptor.addParameter( parameter ); -+ } -+ - protected ExecuteAnnotationContent findExecuteInParentHierarchy( MojoAnnotatedClass mojoAnnotatedClass, - Map mojoAnnotatedClasses ) - { + return mojoDescriptors; + } + ++ private void addParameter( ExtendedMojoDescriptor mojoDescriptor, ++ org.apache.maven.plugin.descriptor.Parameter parameter ) ++ throws DuplicateParameterException ++ { ++ if ( mojoDescriptor.getParameters() != null ) ++ { ++ for ( Iterator it = mojoDescriptor.getParameters().iterator(); it.hasNext(); ) ++ { ++ if ( it.next().equals( parameter ) ) ++ { ++ getLogger().warn( "Duplicate parameter " + parameter.getName() + " field in MOJO descriptor" ); ++ it.remove(); ++ } ++ } ++ } ++ ++ mojoDescriptor.addParameter( parameter ); ++ } ++ + protected ExecuteAnnotationContent findExecuteInParentHierarchy( MojoAnnotatedClass mojoAnnotatedClass, + Map mojoAnnotatedClasses ) + { -- -2.5.5 +2.7.4 diff --git a/0002-Deal-with-nulls-from-getComment.patch b/0002-Deal-with-nulls-from-getComment.patch index 95aad11..311b8da 100644 --- a/0002-Deal-with-nulls-from-getComment.patch +++ b/0002-Deal-with-nulls-from-getComment.patch @@ -1,4 +1,4 @@ -From fddeb4bc426706363023ede3f635ea716990b980 Mon Sep 17 00:00:00 2001 +From 85fc3d643138044f461c3d89b9c6cb2ee58a6036 Mon Sep 17 00:00:00 2001 From: Michael Simacek Date: Mon, 16 Mar 2015 16:42:20 +0100 Subject: [PATCH 2/3] Deal with nulls from getComment @@ -9,58 +9,58 @@ Subject: [PATCH 2/3] Deal with nulls from getComment 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java -index 7a7e70a..644be12 100644 +index a034dc2..0bf6e50 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java @@ -269,7 +269,7 @@ public class JavaAnnotationsMojoDescriptorExtractor - MojoAnnotationContent mojoAnnotationContent = entry.getValue().getMojo(); - if ( mojoAnnotationContent != null ) - { -- mojoAnnotationContent.setDescription( javaClass.getComment() ); -+ mojoAnnotationContent.setDescription( javaClass.getComment() != null ? javaClass.getComment() : "" ); - - DocletTag since = findInClassHierarchy( javaClass, "since" ); - if ( since != null ) + MojoAnnotationContent mojoAnnotationContent = entry.getValue().getMojo(); + if ( mojoAnnotationContent != null ) + { +- mojoAnnotationContent.setDescription( javaClass.getComment() ); ++ mojoAnnotationContent.setDescription( javaClass.getComment() != null ? javaClass.getComment() : "" ); + + DocletTag since = findInClassHierarchy( javaClass, "since" ); + if ( since != null ) @@ -300,7 +300,7 @@ public class JavaAnnotationsMojoDescriptorExtractor - } - - ParameterAnnotationContent parameterAnnotationContent = parameter.getValue(); -- parameterAnnotationContent.setDescription( javaField.getComment() ); -+ parameterAnnotationContent.setDescription( javaClass.getComment() != null ? javaClass.getComment() : "" ); - - DocletTag deprecated = javaField.getTagByName( "deprecated" ); - if ( deprecated != null ) + } + + ParameterAnnotationContent parameterAnnotationContent = parameter.getValue(); +- parameterAnnotationContent.setDescription( javaField.getComment() ); ++ parameterAnnotationContent.setDescription( javaClass.getComment() != null ? javaClass.getComment() : "" ); + + DocletTag deprecated = javaField.getTagByName( "deprecated" ); + if ( deprecated != null ) @@ -326,7 +326,7 @@ public class JavaAnnotationsMojoDescriptorExtractor - } - - ComponentAnnotationContent componentAnnotationContent = component.getValue(); -- componentAnnotationContent.setDescription( javaField.getComment() ); -+ componentAnnotationContent.setDescription( javaClass.getComment() != null ? javaClass.getComment() : "" ); - - DocletTag deprecated = javaField.getTagByName( "deprecated" ); - if ( deprecated != null ) + } + + ComponentAnnotationContent componentAnnotationContent = component.getValue(); +- componentAnnotationContent.setDescription( javaField.getComment() ); ++ componentAnnotationContent.setDescription( javaClass.getComment() != null ? javaClass.getComment() : "" ); + + DocletTag deprecated = javaField.getTagByName( "deprecated" ); + if ( deprecated != null ) diff --git a/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java b/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java -index 7dbd0ef..1bc0158 100644 +index 7ab0957..39a20c1 100644 --- a/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java +++ b/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java @@ -115,7 +115,7 @@ public class JavaJavadocMojoDescriptorExtractor - ExtendedMojoDescriptor mojoDescriptor = new ExtendedMojoDescriptor(); - mojoDescriptor.setLanguage( "java" ); - mojoDescriptor.setImplementation( javaClass.getFullyQualifiedName() ); -- mojoDescriptor.setDescription( javaClass.getComment() ); -+ mojoDescriptor.setDescription( javaClass.getComment() != null ? javaClass.getComment() : "" ); - - // ---------------------------------------------------------------------- - // Mojo annotations in alphabetical order + ExtendedMojoDescriptor mojoDescriptor = new ExtendedMojoDescriptor(); + mojoDescriptor.setLanguage( "java" ); + mojoDescriptor.setImplementation( javaClass.getFullyQualifiedName() ); +- mojoDescriptor.setDescription( javaClass.getComment() ); ++ mojoDescriptor.setDescription( javaClass.getComment() != null ? javaClass.getComment() : "" ); + + // ---------------------------------------------------------------------- + // Mojo annotations in alphabetical order @@ -392,7 +392,7 @@ public class JavaJavadocMojoDescriptorExtractor - - pd.setType( type.getFullyQualifiedName() ); - -- pd.setDescription( field.getComment() ); -+ pd.setDescription( javaClass.getComment() != null ? javaClass.getComment() : "" ); - - DocletTag deprecationTag = field.getTagByName( JavadocMojoAnnotation.DEPRECATED ); - + + pd.setType( type.getFullyQualifiedName() ); + +- pd.setDescription( field.getComment() ); ++ pd.setDescription( javaClass.getComment() != null ? javaClass.getComment() : "" ); + + DocletTag deprecationTag = field.getTagByName( JavadocMojoAnnotation.DEPRECATED ); + -- -2.5.5 +2.7.4 diff --git a/0003-Port-to-plexus-utils-3.0.24.patch b/0003-Port-to-plexus-utils-3.0.24.patch index 9f21057..b2d4b1f 100644 --- a/0003-Port-to-plexus-utils-3.0.24.patch +++ b/0003-Port-to-plexus-utils-3.0.24.patch @@ -1,4 +1,4 @@ -From b48d02316156d3d12e65f209210050bc1026b10c Mon Sep 17 00:00:00 2001 +From 433826f38814e496b78327010a6ffb08569fc297 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Thu, 12 May 2016 09:36:10 +0200 Subject: [PATCH 3/3] Port to plexus-utils 3.0.24 @@ -8,26 +8,26 @@ Subject: [PATCH 3/3] Port to plexus-utils 3.0.24 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java -index f6d4785..839303c 100644 +index 7d444a8..ff2f473 100644 --- a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java +++ b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java @@ -302,7 +302,15 @@ public class PluginHelpGenerator - return; - } - -- Properties properties = PropertyUtils.loadProperties( tmpPropertiesFile ); -+ Properties properties; -+ try -+ { -+ properties = PropertyUtils.loadProperties( tmpPropertiesFile ); -+ } -+ catch ( IOException exc ) -+ { -+ properties = new Properties(); -+ } - - String helpPackageName = properties.getProperty( "helpPackageName" ); - + return; + } + +- Properties properties = PropertyUtils.loadProperties( tmpPropertiesFile ); ++ Properties properties; ++ try ++ { ++ properties = PropertyUtils.loadProperties( tmpPropertiesFile ); ++ } ++ catch ( IOException exc ) ++ { ++ properties = new Properties(); ++ } + + String helpPackageName = properties.getProperty( "helpPackageName" ); + -- -2.5.5 +2.7.4 diff --git a/maven-plugin-tools.spec b/maven-plugin-tools.spec index d27bef3..da32e52 100644 --- a/maven-plugin-tools.spec +++ b/maven-plugin-tools.spec @@ -1,6 +1,6 @@ Name: maven-plugin-tools -Version: 3.4 -Release: 5%{?dist} +Version: 3.5 +Release: 1%{?dist} Epoch: 0 Summary: Maven Plugin Tools License: ASL 2.0 @@ -15,16 +15,17 @@ Patch2: 0003-Port-to-plexus-utils-3.0.24.patch BuildRequires: maven-local BuildRequires: mvn(com.sun:tools) -BuildRequires: mvn(com.thoughtworks.qdox:qdox) >= 2.0 +BuildRequires: mvn(com.thoughtworks.qdox:qdox) BuildRequires: mvn(net.sf.jtidy:jtidy) BuildRequires: mvn(org.apache.ant:ant) BuildRequires: mvn(org.apache.ant:ant-launcher) BuildRequires: mvn(org.apache.maven.doxia:doxia-sink-api) BuildRequires: mvn(org.apache.maven.doxia:doxia-site-renderer) BuildRequires: mvn(org.apache.maven:maven-artifact) +BuildRequires: mvn(org.apache.maven:maven-artifact:2.2.1) BuildRequires: mvn(org.apache.maven:maven-compat) BuildRequires: mvn(org.apache.maven:maven-core) -BuildRequires: mvn(org.apache.maven:maven-model) +BuildRequires: mvn(org.apache.maven:maven-model:2.2.1) BuildRequires: mvn(org.apache.maven:maven-parent:pom:) BuildRequires: mvn(org.apache.maven:maven-plugin-api) BuildRequires: mvn(org.apache.maven:maven-repository-metadata) @@ -33,21 +34,20 @@ BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin) BuildRequires: mvn(org.apache.maven.reporting:maven-reporting-api) BuildRequires: mvn(org.apache.maven.reporting:maven-reporting-impl) +BuildRequires: mvn(org.apache.maven.surefire:maven-surefire-common) BuildRequires: mvn(org.apache.velocity:velocity) BuildRequires: mvn(org.beanshell:bsh) BuildRequires: mvn(org.codehaus.modello:modello-maven-plugin) BuildRequires: mvn(org.codehaus.plexus:plexus-ant-factory) BuildRequires: mvn(org.codehaus.plexus:plexus-archiver) BuildRequires: mvn(org.codehaus.plexus:plexus-bsh-factory) -BuildRequires: mvn(org.codehaus.plexus:plexus-compiler-manager) BuildRequires: mvn(org.codehaus.plexus:plexus-component-annotations) BuildRequires: mvn(org.codehaus.plexus:plexus-component-metadata) -BuildRequires: mvn(org.codehaus.plexus:plexus-container-default) BuildRequires: mvn(org.codehaus.plexus:plexus-utils) BuildRequires: mvn(org.codehaus.plexus:plexus-velocity) +BuildRequires: mvn(org.easymock:easymock) BuildRequires: mvn(org.ow2.asm:asm) BuildRequires: mvn(org.ow2.asm:asm-commons) -BuildRequires: mvn(xmlunit:xmlunit) %description The Maven Plugin Tools contains the necessary tools to be able to produce Maven @@ -174,6 +174,8 @@ API documentation for %{name}. %patch1 -p1 %patch2 -p1 +%pom_remove_plugin :maven-enforcer-plugin + # For com.sun:tools use scope "compile" instead of "system" %pom_remove_dep com.sun:tools maven-plugin-tools-javadoc %pom_add_dep com.sun:tools maven-plugin-tools-javadoc @@ -259,6 +261,9 @@ API documentation for %{name}. %changelog +* Fri Nov 18 2016 Michael Simacek - 0:3.5-1 +- Update to upstream version 3.5 + * Thu May 12 2016 Mikolaj Izdebski - 0:3.4-5 - Port to plexus-utils 3.0.24 diff --git a/sources b/sources index 134c8f5..9348a36 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -275fd44c09bb5bef45548cafafdde270 maven-plugin-tools-3.4-source-release.zip +0adf05a8ab1a59612c90483fff2cfab9 maven-plugin-tools-3.5-source-release.zip