[maven-hpi-plugin] Correctly identify core plugins
Michal Srb
msrb at fedoraproject.org
Tue Nov 18 10:23:45 UTC 2014
commit 556f3dfdee6debbafef4b21700b399d3f4a3d284
Author: Michal Srb <msrb at redhat.com>
Date: Tue Nov 18 09:38:58 2014 +0100
Correctly identify core plugins
correctly-identify-core-plugins.patch | 17 +++++++++++++++++
maven-hpi-plugin.spec | 8 +++++++-
2 files changed, 24 insertions(+), 1 deletions(-)
---
diff --git a/correctly-identify-core-plugins.patch b/correctly-identify-core-plugins.patch
new file mode 100644
index 0000000..a22b594
--- /dev/null
+++ b/correctly-identify-core-plugins.patch
@@ -0,0 +1,17 @@
+diff --git a/src/main/java/org/jenkinsci/maven/plugins/hpi/MavenArtifact.java b/src/main/java/org/jenkinsci/maven/plugins/hpi/MavenArtifact.java
+index 668f224..2cdfb66 100644
+--- a/src/main/java/org/jenkinsci/maven/plugins/hpi/MavenArtifact.java
++++ b/src/main/java/org/jenkinsci/maven/plugins/hpi/MavenArtifact.java
+@@ -51,7 +51,11 @@ public class MavenArtifact {
+ if(!t.equals("jar")) return false;
+
+ // when a plugin depends on another plugin, it doesn't specify the type as hpi, so we need to resolve its POM to see it
+- return resolvePom().getPackaging().equals("hpi");
++ if (resolvePom().getPackaging().equals("hpi") || artifact.getGroupId().equals("org.jenkins-ci.plugins")) {
++ return true;
++ }
++
++ return false;
+ } catch (ProjectBuildingException e) {
+ throw new IOException2("Failed to open artifact "+artifact.toString()+" at "+artifact.getFile(),e);
+ }
diff --git a/maven-hpi-plugin.spec b/maven-hpi-plugin.spec
index 1070986..713e5de 100644
--- a/maven-hpi-plugin.spec
+++ b/maven-hpi-plugin.spec
@@ -1,6 +1,6 @@
Name: maven-hpi-plugin
Version: 1.109
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Maven plugin to build Jenkins plugins
# Project is licensed under ASL 2.0, but following
@@ -22,6 +22,7 @@ Source2: LICENSE-MIT.txt
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
+Patch2: correctly-identify-core-plugins.patch
BuildArch: noarch
@@ -71,6 +72,8 @@ rm ./src/main/java/org/jenkinsci/maven/plugins/hpi/VersionNumber.java
%pom_add_dep org.jenkins-ci:version-number
%patch1 -p1 -F2
+%patch2 -p1
+
# Fix groupId for ant-apache-regexp
%pom_xpath_replace "pom:dependency[pom:artifactId[text()='ant-apache-regexp']]/pom:groupId" \
"<groupId>org.apache.ant</groupId>"
@@ -112,6 +115,9 @@ rm src/main/java/org/jenkinsci/maven/plugins/hpi/CreateMojo.java
%changelog
+* Tue Nov 18 2014 Michal Srb <msrb at redhat.com> - 1.109-2
+- Correctly identify core plugins
+
* Mon Jun 16 2014 Michal Srb <msrb at redhat.com> - 1.109-1
- Update to upstream version 1.109
More information about the scm-commits
mailing list