Fridrich Strba 2019-03-29 13:23:40 +00:00 committed by Git OBS Bridge
commit 01b169e490
9 changed files with 556 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,68 @@
From 0ebe12503766c6a76c507498e9e7f0cb1c4469c2 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Mon, 16 Mar 2015 14:29:21 +0100
Subject: [PATCH 1/3] Avoid duplicate MOJO parameters
---
.../JavaAnnotationsMojoDescriptorExtractor.java | 24 ++++++++++++++++++++--
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 587ddad..231ed12 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;
@@ -573,7 +574,7 @@ public class JavaAnnotationsMojoDescriptorExtractor
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 );
@@ -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<String, MojoAnnotatedClass> mojoAnnotatedClasses )
{
--
2.14.3

View File

@ -0,0 +1,66 @@
From ea64c5b59f5f820a73ab3e82b6898762e55a8719 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Mon, 16 Mar 2015 16:42:20 +0100
Subject: [PATCH 2/3] Deal with nulls from getComment
---
.../annotations/JavaAnnotationsMojoDescriptorExtractor.java | 6 +++---
.../extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java | 4 ++--
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 231ed12..6ac677b 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 )
@@ -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 )
@@ -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 )
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 137d90d..36b30dc 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
@@ -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 );
--
2.14.3

View File

@ -0,0 +1,33 @@
From 690138ca262b03d7e43336dd9bfee2ca0e1b03f9 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Thu, 12 May 2016 09:36:10 +0200
Subject: [PATCH 3/3] Port to plexus-utils 3.0.24
---
.../maven/tools/plugin/generator/PluginHelpGenerator.java | 10 +++++++++-
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 23c3ed9..7543496 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" );
--
2.14.3

22
fix-getPluginsAsMap.patch Normal file
View File

@ -0,0 +1,22 @@
--- maven-plugin-tools-3.5.1/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java 2018-11-08 19:20:01.544523214 +0100
+++ maven-plugin-tools-3.5.1/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java 2018-11-08 19:30:02.187309471 +0100
@@ -765,7 +765,6 @@
return jdk;
}
- @SuppressWarnings( "unchecked" )
Plugin compiler = getCompilerPlugin( project.getBuild().getPluginsAsMap() );
if ( compiler == null )
{
@@ -797,9 +796,9 @@
return "Unknown";
}
- private static Plugin getCompilerPlugin( Map<String, Object> pluginsAsMap )
+ private static Plugin getCompilerPlugin( Map<String, Plugin> pluginsAsMap )
{
- return (Plugin) pluginsAsMap.get( "org.apache.maven.plugins:maven-compiler-plugin" );
+ return pluginsAsMap.get( "org.apache.maven.plugins:maven-compiler-plugin" );
}
private static String getPluginParameter( Plugin plugin, String parameter )

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fb1f44c5c17f8e2ec5904a49dcf122dd72504bb37d62f410a04737ef03740ef7
size 769553

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ddb6fd9c622f54c5fe65ef05e80b47c98796ae3e1b329da1a4125b8e76d3eff1
size 4388

View File

@ -0,0 +1,7 @@
-------------------------------------------------------------------
Fri Mar 29 13:22:25 UTC 2019 - Fridrich Strba <fstrba@suse.com>
- Initial packaging of maven-plugin-tools 3.5.1
- Generate and customize ant build files
- Do not build maven-plugin-plugin in this spec, since it has
circular dependency on itself

331
maven-plugin-tools.spec Normal file
View File

@ -0,0 +1,331 @@
#
# spec file for package maven-plugin-tools
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: maven-plugin-tools
Version: 3.5.1
Release: 0
Summary: Maven Plugin Tools
License: Apache-2.0
Group: Development/Libraries/Java
URL: http://maven.apache.org/plugin-tools/
Source0: http://repo2.maven.org/maven2/org/apache/maven/plugin-tools/%{name}/%{version}/%{name}-%{version}-source-release.zip
Source1: %{name}-build.tar.xz
Patch0: 0001-Avoid-duplicate-MOJO-parameters.patch
Patch1: 0002-Deal-with-nulls-from-getComment.patch
Patch2: 0003-Port-to-plexus-utils-3.0.24.patch
Patch10: fix-getPluginsAsMap.patch
BuildRequires: ant
BuildRequires: apache-commons-cli
BuildRequires: atinject
BuildRequires: bsh2
BuildRequires: fdupes
BuildRequires: google-guice
BuildRequires: guava20
BuildRequires: java-1_8_0-openjdk-devel
BuildRequires: javapackages-local
BuildRequires: jdom2
BuildRequires: jtidy
BuildRequires: junit
BuildRequires: maven-lib
BuildRequires: maven-reporting-api
BuildRequires: modello
BuildRequires: objectweb-asm
BuildRequires: plexus-ant-factory
BuildRequires: plexus-archiver
BuildRequires: plexus-bsh-factory
BuildRequires: plexus-classworlds
BuildRequires: plexus-cli
BuildRequires: plexus-containers-component-annotations
BuildRequires: plexus-metadata-generator
BuildRequires: plexus-utils
BuildRequires: plexus-velocity
BuildRequires: qdox
BuildRequires: sisu-inject
BuildRequires: sisu-plexus
BuildRequires: unzip
BuildRequires: velocity
BuildRequires: xbean
BuildRequires: xmvn-install
BuildRequires: xmvn-resolve
BuildRequires: mvn(org.apache.maven:maven-parent:pom:)
BuildConflicts: java-devel >= 9
BuildArch: noarch
%description
The Maven Plugin Tools contains the necessary tools to be able to produce Maven
Plugins in a variety of languages.
%package -n maven-plugin-annotations
Summary: Maven Plugin Java 5 Annotations
Group: Development/Libraries/Java
%description -n maven-plugin-annotations
This package contains Java 5 annotations to use in Mojos.
%package annotations
Summary: Maven Plugin Tool for Annotations
Group: Development/Libraries/Java
%description annotations
This package provides Java 5 annotation tools for use with Apache Maven.
%package ant
Summary: Maven Plugin Tool for Ant
Group: Development/Libraries/Java
%description ant
Descriptor extractor for plugins written in Ant.
%package api
Summary: Maven Plugin Tools APIs
Group: Development/Libraries/Java
%description api
The Maven Plugin Tools API provides an API to extract information from
and generate documentation for Maven Plugins.
%package beanshell
Summary: Maven Plugin Tool for Beanshell
Group: Development/Libraries/Java
%description beanshell
Descriptor extractor for plugins written in Beanshell.
%package generators
Summary: Maven Plugin Tools Generators
Group: Development/Libraries/Java
%description generators
The Maven Plugin Tools Generators provides content generation
(documentation, help) from plugin descriptor.
%package java
Summary: Maven Plugin Tool for Java
Group: Development/Libraries/Java
%description java
Descriptor extractor for plugins written in Java.
# Note that this package contains code, not documentation.
# See comments about "javadocs" subpackage below.
%package javadoc
Summary: Maven Plugin Tools Javadoc
Group: Development/Libraries/Java
%description javadoc
The Maven Plugin Tools Javadoc provides several Javadoc taglets to be used when
generating Javadoc.
Java API documentation for %{name} is contained in
%{name}-javadocs package. This package does not contain it.
%package model
Summary: Maven Plugin Metadata Model
Group: Development/Libraries/Java
%description model
The Maven Plugin Metadata Model provides an API to play with the Metadata
model.
%package -n maven-script-ant
Summary: Maven Ant Mojo Support
Group: Development/Libraries/Java
%description -n maven-script-ant
This package provides %{summary}, which write Maven plugins with
Ant scripts.
%package -n maven-script-beanshell
Summary: Maven Beanshell Mojo Support
Group: Development/Libraries/Java
%description -n maven-script-beanshell
This package provides %{summary}, which write Maven plugins with
Beanshell scripts.
# The subpackage name "javadocs" instead of "javadoc" is intentional.
%package javadocs
Summary: Javadoc for %{name}
Group: Development/Libraries/Java
%description javadocs
API documentation for %{name}.
%prep
%setup -q -a1
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch10 -p1
%pom_remove_plugin -r :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
%pom_xpath_inject "pom:project/pom:properties" "
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>"
# Remove test dependencies because tests are skipped anyways.
%pom_xpath_remove "pom:dependency[pom:scope='test']"
# Use Maven 3.1.1 APIs
%pom_remove_dep :maven-project maven-plugin-plugin
%pom_remove_dep :maven-plugin-descriptor maven-plugin-plugin
%pom_remove_dep :maven-plugin-registry maven-plugin-plugin
%pom_remove_dep :maven-artifact-manager maven-plugin-plugin
%pom_change_dep :maven-project :maven-core maven-plugin-tools-annotations
%pom_change_dep :maven-plugin-descriptor :maven-compat maven-plugin-tools-annotations
%pom_change_dep :easymock :easymock::test maven-plugin-tools-annotations
%pom_remove_dep :maven-plugin-descriptor maven-script/maven-plugin-tools-ant
%pom_change_dep :maven-project :maven-core maven-script/maven-plugin-tools-ant
%pom_remove_dep :maven-plugin-descriptor maven-plugin-tools-api
%pom_change_dep :maven-project :maven-core maven-plugin-tools-api
%pom_remove_dep :maven-plugin-descriptor maven-script/maven-plugin-tools-beanshell
%pom_remove_dep :maven-project maven-plugin-tools-generators
%pom_remove_dep :maven-plugin-descriptor maven-plugin-tools-generators
%pom_change_dep :maven-project :maven-core maven-plugin-tools-java
%pom_remove_dep :maven-plugin-descriptor maven-plugin-tools-java
%pom_change_dep :maven-plugin-descriptor :maven-plugin-api maven-script/maven-plugin-tools-model
%pom_remove_dep :maven-project maven-script/maven-script-ant
%pom_remove_dep :maven-plugin-descriptor maven-script/maven-script-ant
%pom_change_dep :easymock :easymock::test maven-script/maven-script-ant
%pom_remove_dep :maven-project
%pom_remove_dep :maven-plugin-descriptor
%pom_add_dep org.apache.maven:maven-compat
%mvn_package :maven-plugin-tools __noinstall
%mvn_package :maven-script __noinstall
%mvn_package :{*} @1
%build
mkdir -p lib
build-jar-repository -s lib \
ant \
ant-launcher \
atinject \
bsh2/bsh \
commons-cli \
guava20/guava-10.0 \
guice/google-guice-no_aop \
jdom2/jdom2 \
jtidy \
junit \
maven/maven-artifact \
maven/maven-compat \
maven/maven-core \
maven/maven-model \
maven/maven-plugin-api \
maven-reporting-api/maven-reporting-api \
objectweb-asm/asm \
objectweb-asm/asm-commons \
org.eclipse.sisu.inject \
org.eclipse.sisu.plexus \
plexus/ant-factory \
plexus/archiver \
plexus/bsh-factory \
plexus-classworlds \
plexus/cli \
plexus-containers/plexus-component-annotations \
plexus-metadata-generator \
plexus/utils \
plexus-velocity/plexus-velocity \
qdox \
velocity \
xbean/xbean-reflect
ln -s $(xmvn-resolve com.sun:tools) lib/
%ant \
-Dtest.skip=true \
package javadoc
%mvn_artifact pom.xml
%mvn_artifact maven-script/pom.xml
mkdir -p target/site/apidocs
for i in \
maven-plugin-annotations \
maven-plugin-tools-annotations \
maven-plugin-tools-api \
maven-plugin-tools-generators \
maven-plugin-tools-java \
maven-plugin-tools-javadoc; do
%mvn_artifact ${i}/pom.xml ${i}/target/${i}-%{version}.jar
if [ -d ${i}/target/site/apidocs ]; then
cp -r ${i}/target/site/apidocs target/site/apidocs/${i}
fi
done
for i in \
maven-plugin-tools-ant \
maven-plugin-tools-beanshell \
maven-plugin-tools-model \
maven-script-ant \
maven-script-beanshell; do
%mvn_artifact maven-script/${i}/pom.xml maven-script/${i}/target/${i}-%{version}.jar
if [ -d maven-script/${i}/target/site/apidocs ]; then
cp -r maven-script/${i}/target/site/apidocs target/site/apidocs/${i}
fi
done
%install
%mvn_install
%fdupes -s %{buildroot}%{_javadocdir}
%files -n maven-plugin-annotations -f .mfiles-maven-plugin-annotations
%files annotations -f .mfiles-maven-plugin-tools-annotations
%license LICENSE NOTICE
%files ant -f .mfiles-maven-plugin-tools-ant
%files api -f .mfiles-maven-plugin-tools-api
%license LICENSE NOTICE
%files beanshell -f .mfiles-maven-plugin-tools-beanshell
%files generators -f .mfiles-maven-plugin-tools-generators
%files java -f .mfiles-maven-plugin-tools-java
%files javadoc -f .mfiles-maven-plugin-tools-javadoc
%files model -f .mfiles-maven-plugin-tools-model
%license LICENSE NOTICE
%files -n maven-script-ant -f .mfiles-maven-script-ant
%license LICENSE NOTICE
%files -n maven-script-beanshell -f .mfiles-maven-script-beanshell
%license LICENSE NOTICE
%files javadocs -f .mfiles-javadoc
%license LICENSE NOTICE
%changelog