[maven-hpi-plugin/f19] Initial import

Michal Srb msrb at fedoraproject.org
Fri May 31 05:35:02 UTC 2013


commit fddbdf29ab9159ce87b742d6e1af5007e5a07005
Author: Michal Srb <msrb at redhat.com>
Date:   Fri May 31 07:34:16 2013 +0200

    Initial import

 .gitignore                                        |    3 +
 0001-Unbundle-org.jenkins-ci-version-number.patch |   35 +++++++
 0001-Update-maven-archiver-to-2.5.patch           |  104 +++++++++++++++++++++
 maven-hpi-plugin.spec                             |  101 ++++++++++++++++++++
 sources                                           |    3 +
 5 files changed, 246 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..0b54acd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,3 @@
+/maven-hpi-plugin-1.95.tar.gz
+/LICENSE-2.0.txt
+/LICENSE-MIT.txt
diff --git a/0001-Unbundle-org.jenkins-ci-version-number.patch b/0001-Unbundle-org.jenkins-ci-version-number.patch
new file mode 100644
index 0000000..8440a49
--- /dev/null
+++ b/0001-Unbundle-org.jenkins-ci-version-number.patch
@@ -0,0 +1,35 @@
+From 6907ab7f9c1d9530755d22a090f4db7c07b570ac Mon Sep 17 00:00:00 2001
+From: Michal Srb <msrb at redhat.com>
+Date: Tue, 28 May 2013 12:59:32 +0200
+Subject: [PATCH] Unbundle org.jenkins-ci:version-number
+
+---
+ src/main/java/org/jenkinsci/maven/plugins/hpi/TestInsertionMojo.java | 1 +
+ src/main/java/org/jenkinsci/maven/plugins/hpi/ValidateMojo.java      | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/main/java/org/jenkinsci/maven/plugins/hpi/TestInsertionMojo.java b/src/main/java/org/jenkinsci/maven/plugins/hpi/TestInsertionMojo.java
+index 665131d..305a621 100644
+--- a/src/main/java/org/jenkinsci/maven/plugins/hpi/TestInsertionMojo.java
++++ b/src/main/java/org/jenkinsci/maven/plugins/hpi/TestInsertionMojo.java
+@@ -1,5 +1,6 @@
+ package org.jenkinsci.maven.plugins.hpi;
+ 
++import hudson.util.VersionNumber;
+ import org.apache.maven.plugin.MojoExecutionException;
+ import org.apache.maven.plugin.MojoFailureException;
+ import org.apache.maven.project.MavenProject;
+diff --git a/src/main/java/org/jenkinsci/maven/plugins/hpi/ValidateMojo.java b/src/main/java/org/jenkinsci/maven/plugins/hpi/ValidateMojo.java
+index a287cac..b65018d 100644
+--- a/src/main/java/org/jenkinsci/maven/plugins/hpi/ValidateMojo.java
++++ b/src/main/java/org/jenkinsci/maven/plugins/hpi/ValidateMojo.java
+@@ -1,5 +1,6 @@
+ package org.jenkinsci.maven.plugins.hpi;
+ 
++import hudson.util.VersionNumber;
+ import org.apache.maven.plugin.MojoExecutionException;
+ import org.apache.maven.plugin.MojoFailureException;
+ 
+-- 
+1.8.1.4
+
diff --git a/0001-Update-maven-archiver-to-2.5.patch b/0001-Update-maven-archiver-to-2.5.patch
new file mode 100644
index 0000000..5999924
--- /dev/null
+++ b/0001-Update-maven-archiver-to-2.5.patch
@@ -0,0 +1,104 @@
+From 933c977d136edfbbb667230e294ed5980f9587e2 Mon Sep 17 00:00:00 2001
+From: Michal Srb <msrb at redhat.com>
+Date: Mon, 6 May 2013 12:40:44 +0200
+Subject: [PATCH 1/2] Update maven-archiver to 2.5
+
+---
+ pom.xml                                                            | 2 +-
+ src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractHpiMojo.java | 7 ++-----
+ src/main/java/org/jenkinsci/maven/plugins/hpi/HpiMojo.java         | 4 ++--
+ src/main/java/org/jenkinsci/maven/plugins/hpi/HplMojo.java         | 4 ++--
+ 4 files changed, 7 insertions(+), 10 deletions(-)
+
+diff --git a/pom.xml b/pom.xml
+index 0668768..d172bfc 100644
+--- a/pom.xml
++++ b/pom.xml
+@@ -144,7 +144,7 @@
+     <dependency>
+       <groupId>org.apache.maven</groupId>
+       <artifactId>maven-archiver</artifactId>
+-      <version>2.0.1</version>
++      <version>2.5</version>
+     </dependency>
+     <dependency>
+       <groupId>org.codehaus.plexus</groupId>
+diff --git a/src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractHpiMojo.java b/src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractHpiMojo.java
+index 6fb445e..2d6dfb3 100644
+--- a/src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractHpiMojo.java
++++ b/src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractHpiMojo.java
+@@ -31,7 +31,7 @@ import org.apache.maven.project.MavenProjectBuilder;
+ import org.codehaus.plexus.archiver.ArchiverException;
+ import org.codehaus.plexus.archiver.UnArchiver;
+ import org.codehaus.plexus.archiver.jar.Manifest.Attribute;
+-import org.codehaus.plexus.archiver.jar.Manifest.Section;
++import org.codehaus.plexus.archiver.jar.Manifest.ExistingSection;
+ import org.codehaus.plexus.archiver.jar.ManifestException;
+ import org.codehaus.plexus.archiver.manager.ArchiverManager;
+ import org.codehaus.plexus.archiver.manager.NoSuchArchiverException;
+@@ -645,9 +645,6 @@ public abstract class AbstractHpiMojo extends AbstractJenkinsMojo {
+             unArchiver.setDestDirectory(location);
+             unArchiver.extract();
+         }
+-        catch (IOException e) {
+-            throw new MojoExecutionException("Error unpacking file: " + file + "to: " + location, e);
+-        }
+         catch (ArchiverException e) {
+             throw new MojoExecutionException("Error unpacking file: " + file + "to: " + location, e);
+         }
+@@ -900,7 +897,7 @@ public abstract class AbstractHpiMojo extends AbstractJenkinsMojo {
+     }
+ 
+ 
+-    protected void setAttributes(Section mainSection) throws MojoExecutionException, ManifestException, IOException {
++    protected void setAttributes(ExistingSection mainSection) throws MojoExecutionException, ManifestException, IOException {
+         File pluginImpl = new File(project.getBuild().getOutputDirectory(), "META-INF/services/hudson.Plugin");
+         if(pluginImpl.exists()) {
+             BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(pluginImpl),"UTF-8"));
+diff --git a/src/main/java/org/jenkinsci/maven/plugins/hpi/HpiMojo.java b/src/main/java/org/jenkinsci/maven/plugins/hpi/HpiMojo.java
+index fe2878e..020194b 100644
+--- a/src/main/java/org/jenkinsci/maven/plugins/hpi/HpiMojo.java
++++ b/src/main/java/org/jenkinsci/maven/plugins/hpi/HpiMojo.java
+@@ -24,7 +24,7 @@ import org.apache.maven.project.MavenProjectHelper;
+ import org.codehaus.plexus.archiver.ArchiverException;
+ import org.codehaus.plexus.archiver.jar.JarArchiver;
+ import org.codehaus.plexus.archiver.jar.Manifest;
+-import org.codehaus.plexus.archiver.jar.Manifest.Section;
++import org.codehaus.plexus.archiver.jar.Manifest.ExistingSection;
+ import org.codehaus.plexus.archiver.jar.ManifestException;
+ import org.codehaus.plexus.util.IOUtil;
+ 
+@@ -180,7 +180,7 @@ public class HpiMojo extends AbstractHpiMojo {
+         PrintWriter printWriter = null;
+         try {
+             Manifest mf = ma.getManifest(project, archive.getManifest());
+-            Section mainSection = mf.getMainSection();
++            ExistingSection mainSection = mf.getMainSection();
+             setAttributes(mainSection);
+ 
+             printWriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(manifestFile),"UTF-8"));
+diff --git a/src/main/java/org/jenkinsci/maven/plugins/hpi/HplMojo.java b/src/main/java/org/jenkinsci/maven/plugins/hpi/HplMojo.java
+index 45f0d02..a8650fa 100644
+--- a/src/main/java/org/jenkinsci/maven/plugins/hpi/HplMojo.java
++++ b/src/main/java/org/jenkinsci/maven/plugins/hpi/HplMojo.java
+@@ -8,7 +8,7 @@ import org.apache.maven.plugin.MojoExecutionException;
+ import org.apache.maven.plugin.MojoFailureException;
+ import org.codehaus.plexus.archiver.jar.Manifest;
+ import org.codehaus.plexus.archiver.jar.Manifest.Attribute;
+-import org.codehaus.plexus.archiver.jar.Manifest.Section;
++import org.codehaus.plexus.archiver.jar.Manifest.ExistingSection;
+ import org.codehaus.plexus.archiver.jar.ManifestException;
+ import org.codehaus.plexus.util.IOUtil;
+ 
+@@ -51,7 +51,7 @@ public class HplMojo extends AbstractHpiMojo {
+         PrintWriter printWriter = null;
+         try {
+             Manifest mf = new Manifest();
+-            Section mainSection = mf.getMainSection();
++            ExistingSection mainSection = mf.getMainSection();
+             setAttributes(mainSection);
+ 
+             // compute Libraries entry
+-- 
+1.8.1.4
+
diff --git a/maven-hpi-plugin.spec b/maven-hpi-plugin.spec
new file mode 100644
index 0000000..0aab67a
--- /dev/null
+++ b/maven-hpi-plugin.spec
@@ -0,0 +1,101 @@
+Name:           maven-hpi-plugin
+Version:        1.95
+Release:        1%{?dist}
+Summary:        Maven plugin to build Jenkins plugins
+
+# Project is licensed under ASL 2.0, but following
+# files are licensed under MIT:
+# src/main/java/hudson/Extension.java
+# src/main/java/jenkins/YesNoMaybe.java
+License:        ASL 2.0 and MIT
+URL:            https://github.com/jenkinsci/maven-hpi-plugin
+Source0:        https://github.com/jenkinsci/%{name}/archive/%{name}-%{version}.tar.gz
+# Stapler/Jenkins guys don't want to add whole ASL 2.0 license
+# text to the repository. Their opinion is that having short ASL 2.0 notice
+# in affected files is enough
+Source1:        http://www.apache.org/licenses/LICENSE-2.0.txt
+# MIT license text copied from MIT licesed file (see comment for license tag)
+Source2:        LICENSE-MIT.txt
+
+# Port to newer version of maven-archiver
+# TODO possibly upstreamable (need testing)
+Patch0:         0001-Update-maven-archiver-to-2.5.patch
+# Bundled class from org.jenkins-ci:version-number
+Patch1:         0001-Unbundle-org.jenkins-ci-version-number.patch
+
+BuildArch:      noarch
+
+BuildRequires:  maven-local
+BuildRequires:  mvn(com.sun.codemodel:codemodel)
+BuildRequires:  mvn(net.java.sezpoz:sezpoz)
+BuildRequires:  mvn(org.apache.maven.plugins:maven-archetype-plugin)
+BuildRequires:  mvn(org.apache.maven:maven-archiver)
+BuildRequires:  mvn(org.apache.maven:maven-artifact)
+BuildRequires:  mvn(org.apache.maven:maven-plugin-api)
+BuildRequires:  mvn(org.apache.maven:maven-project)
+BuildRequires:  mvn(org.codehaus.plexus:plexus-interactivity-api)
+BuildRequires:  mvn(org.codehaus.plexus:plexus-utils)
+BuildRequires:  mvn(org.kohsuke.stapler:stapler-groovy)
+BuildRequires:  mvn(org.jenkins-ci:version-number)
+BuildRequires:  mvn(net.sf.ezmorph:ezmorph)
+BuildRequires:  ant-apache-regexp
+
+
+%description
+This package contains Apache Maven plugin for developing
+plugins for Jenkins.
+
+%package        javadoc
+Summary:        Javadoc for %{name}
+
+%description    javadoc
+This package contains the API documentation for %{name}.
+
+
+%prep
+%setup -q -n %{name}-%{name}-%{version}
+
+cp %{SOURCE1} LICENSE-ASL
+cp %{SOURCE2} LICENSE-MIT
+
+%patch0 -p1
+
+# Replace bundled class from org.jenkins-ci:version-number with proper dependency
+rm ./src/main/java/org/jenkinsci/maven/plugins/hpi/VersionNumber.java
+%pom_add_dep org.jenkins-ci:version-number
+%patch1 -p1
+
+# Nothing really interesting in parent
+%pom_remove_parent
+
+
+# Remove "run" mojo, it requires jetty 6
+rm src/main/java/org/jenkinsci/maven/plugins/hpi/ServletApiOnlyClassLoader.java
+rm src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractJetty6Mojo.java
+rm src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractJettyMojo.java
+rm src/main/java/org/jenkinsci/maven/plugins/hpi/RunMojo.java
+rm src/main/java/org/jenkinsci/maven/plugins/hpi/ConsoleScanner.java
+%pom_remove_dep :maven-jetty-plugin
+%pom_remove_dep :maven-stapler-plugin
+
+# Remove "create" mojo, it requires some maven-archetype-plugin (1.0-alpha-4)
+# It doesn't work with version 2.2
+rm src/main/java/org/jenkinsci/maven/plugins/hpi/CreateMojo.java
+
+%build
+%mvn_build
+
+%install
+%mvn_install
+
+
+%files -f .mfiles
+%doc LICENSE-ASL LICENSE-MIT
+%files javadoc -f .mfiles-javadoc
+%doc LICENSE-ASL LICENSE-MIT
+
+
+%changelog
+* Mon May 06 2013 Michal Srb <msrb at redhat.com> - 1.95-1
+- Initial package
+
diff --git a/sources b/sources
index e69de29..7b975f7 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,3 @@
+6bdd5d3faf51ae613c0466d3b11fdebd  maven-hpi-plugin-1.95.tar.gz
+3b83ef96387f14655fc854ddc3c6bd57  LICENSE-2.0.txt
+0f3abd1e8ab49fa980c02e7b8e543fc3  LICENSE-MIT.txt


More information about the scm-commits mailing list