[maven-help-plugin] Fix build in pure maven 3 environment.

Alexander Kurtakov akurtakov at fedoraproject.org
Tue Dec 6 10:41:10 UTC 2011


commit f8f03fcaf3324c7c993ee5b3a970634fc5c12212
Author: Alexander Kurtakov < <akurtako at redhat.com>
Date:   Tue Dec 6 12:40:15 2011 +0200

    Fix build in pure maven 3 environment.

 add-compat.patch                 |   23 +++++++++++++++++++++++
 maven-help-plugin-jpp-depmap.xml |    9 ---------
 maven-help-plugin.spec           |   26 +++++++++++---------------
 reduce-exception.patch           |   13 +++++++++++++
 4 files changed, 47 insertions(+), 24 deletions(-)
---
diff --git a/add-compat.patch b/add-compat.patch
new file mode 100644
index 0000000..1549011
--- /dev/null
+++ b/add-compat.patch
@@ -0,0 +1,23 @@
+--- pom.xml.sav	2010-03-23 13:12:58.000000000 +0200
++++ pom.xml	2011-12-06 12:27:06.234878050 +0200
+@@ -79,11 +79,6 @@ under the License.
+     </dependency>
+     <dependency>
+       <groupId>org.apache.maven</groupId>
+-      <artifactId>maven-plugin-descriptor</artifactId>
+-      <version>2.0.6</version>
+-    </dependency>
+-    <dependency>
+-      <groupId>org.apache.maven</groupId>
+       <artifactId>maven-project</artifactId>
+       <version>2.0.6</version>
+     </dependency>
+@@ -104,7 +99,7 @@ under the License.
+     </dependency>
+     <dependency>
+       <groupId>org.apache.maven</groupId>
+-      <artifactId>maven-plugin-parameter-documenter</artifactId>
++      <artifactId>maven-compat</artifactId>
+       <version>2.0.6</version>
+     </dependency>
+ 
diff --git a/maven-help-plugin.spec b/maven-help-plugin.spec
index 189a9ae..65f6896 100644
--- a/maven-help-plugin.spec
+++ b/maven-help-plugin.spec
@@ -1,13 +1,14 @@
 Name:           maven-help-plugin
 Version:        2.1.1
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Plugin to to get relative information about a project or the system
 
 Group:          Development/Libraries
 License:        ASL 2.0
 URL:            http://maven.apache.org/plugins/maven-help-plugin/
 Source0:        http://repo2.maven.org/maven2/org/apache/maven/plugins/%{name}/%{version}/%{name}-%{version}-source-release.zip
-Source1:        %{name}-jpp-depmap.xml
+Patch0:         add-compat.patch
+Patch1:         reduce-exception.patch
 
 BuildArch: noarch
 
@@ -31,8 +32,6 @@ Requires: maven
 Requires: jpackage-utils
 Requires: java
 Requires: xstream
-Requires(post): jpackage-utils
-Requires(postun): jpackage-utils 
 
 Obsoletes: maven2-plugin-help < 0:%{version}-%{release}
 Provides: maven2-plugin-help = 0:%{version}-%{release}
@@ -55,11 +54,12 @@ API documentation for %{name}.
 
 %prep
 %setup -q 
+%patch0
+%patch1
 
 %build
 # no junit-addons, skip test
 mvn-rpmbuild \
-        -Dmaven.local.depmap.file=%{SOURCE1} \
         -Dmaven.test.skip=true \
         install javadoc:javadoc
 
@@ -68,23 +68,16 @@ mvn-rpmbuild \
 install -d -m 0755 %{buildroot}%{_javadir}
 install -m 644 target/%{name}-%{version}.jar   %{buildroot}%{_javadir}/%{name}.jar
 
-%add_to_maven_depmap org.apache.maven.plugins %{name} %{version} JPP %{name}
-
 # poms
 install -d -m 755 %{buildroot}%{_mavenpomdir}
-install -pm 644 pom.xml \
-    %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
+install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
+
+%add_maven_depmap JPP-%{name}.pom %{name}.jar
 
 # javadoc
 install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}
 cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}/
 
-%post
-%update_maven_depmap
-
-%postun
-%update_maven_depmap
-
 %files
 %{_javadir}/*
 %{_mavenpomdir}/*
@@ -94,6 +87,9 @@ cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}/
 %{_javadocdir}/%{name}
 
 %changelog
+* Tue Dec 6 2011 Alexander Kurtakov <akurtako at redhat.com> 2.1.1-4
+- Fix build in pure maven 3 environment.
+
 * Thu Jun 9 2011 Alexander Kurtakov <akurtako at redhat.com> 2.1.1-3
 - Build with maven 3.x.
 - Use upstream sources.
diff --git a/reduce-exception.patch b/reduce-exception.patch
new file mode 100644
index 0000000..c3f6491
--- /dev/null
+++ b/reduce-exception.patch
@@ -0,0 +1,13 @@
+--- src/main/java/org/apache/maven/plugins/help/DescribeMojo.java.sav	2010-03-23 13:12:58.000000000 +0200
++++ src/main/java/org/apache/maven/plugins/help/DescribeMojo.java	2011-12-06 12:30:59.793674390 +0200
+@@ -902,10 +902,6 @@ public class DescribeMojo
+             {
+                 throw new MojoFailureException( "ComponentLookupException: " + e.getMessage() );
+             }
+-            catch ( LifecycleExecutionException e )
+-            {
+-                throw new MojoFailureException( "LifecycleExecutionException: " + e.getMessage() );
+-            }
+ 
+             return false;
+         }


More information about the scm-commits mailing list