[Bug 824789] New: mvn-rpmbuild should support versions
by Red Hat Bugzilla
https://bugzilla.redhat.com/show_bug.cgi?id=824789
Bug ID: 824789
QA Contact: extras-qa(a)fedoraproject.org
Severity: high
Version: 17
Priority: high
CC: akurtako(a)redhat.com,
java-sig-commits(a)lists.fedoraproject.org,
sochotni(a)redhat.com
Assignee: sochotni(a)redhat.com
Summary: mvn-rpmbuild should support versions
Regression: ---
Story Points: ---
Classification: Fedora
OS: Linux
Reporter: kdaniel(a)redhat.com
Type: Bug
Documentation: ---
Hardware: Unspecified
Mount Type: ---
Status: NEW
Component: maven
Product: Fedora
I have just tried to build Eclipse with mvn-rpmbuild (the build was successful
with pure mvn) and it fails with the duplication error:
eclipse.pde:org.eclipse.pde=[
/home/kdaniel/cbi/R4_platform-aggregator/eclipse.pde/org.eclipse.pde/pom.xml,
/home/kdaniel/cbi/R4_platform-aggregator/eclipse.pde/org.eclipse.pde-feature/pom.xml],
org.eclipse.platform.runtime:org.eclipse.core.tools=[
/home/kdaniel/cbi/R4_platform-aggregator/eclipse.platform.runtime/bundles/org.eclipse.core.tools/pom.xml,
/home/kdaniel/cbi/R4_platform-aggregator/eclipse.platform.runtime/features/org.eclipse.core.tools-feature/pom.xml],
org.eclipse.equinox.bundles:org.eclipse.equinox.http.jetty=[
/home/kdaniel/cbi/R4_platform-aggregator/rt.equinox.bundles/bundles/org.eclipse.equinox.http.jetty5/pom.xml,
/home/kdaniel/cbi/R4_platform-aggregator/rt.equinox.bundles/bundles/org.eclipse.equinox.http.jetty6/pom.xml,
/home/kdaniel/cbi/R4_platform-aggregator/rt.equinox.bundles/bundles/org.eclipse.equinox.http.jetty8/pom.xml]
For the historical reasons, and for the compatibility sake, it will be
difficult to change names of affected bundles...
--
You are receiving this mail because:
You are on the CC list for the bug.
11 years, 11 months
[javapackages-tools] Update to upstream version 0.6.0
by Stanislav Ochotnicky
commit 2388607c5bcf763727a97fd147ddae71c54ab4f2
Author: Stanislav Ochotnicky <sochotnicky(a)redhat.com>
Date: Mon Jul 30 15:11:05 2012 +0200
Update to upstream version 0.6.0
- Make maven provides versioned
- Add additional pom_ macros to simplify additional pom editing
.gitignore | 1 +
javapackages-tools.spec | 7 ++++++-
sources | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 4b8eb4b..d252f75 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
/javapackages-0.4.0.tar.xz
/javapackages-0.4.1.tar.xz
/javapackages-0.5.0.tar.xz
+/javapackages-0.6.0.tar.xz
diff --git a/javapackages-tools.spec b/javapackages-tools.spec
index d809d20..4a95405 100644
--- a/javapackages-tools.spec
+++ b/javapackages-tools.spec
@@ -1,5 +1,5 @@
Name: javapackages-tools
-Version: 0.5.0
+Version: 0.6.0
Release: 1%{?dist}
Summary: Fedora macros and scripts for Java packaging support
@@ -51,6 +51,11 @@ install -pm 644 scripts/pom_editor.sh $RPM_BUILD_ROOT%{_javadir}-utils/
%changelog
+* Mon Jul 30 2012 Stanislav Ochotnicky <sochotnicky(a)redhat.com> - 0.6.0-1
+- Update to upstream version 0.6.0
+- Make maven provides versioned
+- Add additional pom_ macros to simplify additional pom editing
+
* Wed Jul 25 2012 Stanislav Ochotnicky <sochotnicky(a)redhat.com> - 0.5.0-1
- Update to upstream version 0.5.0 - add support for add_maven_depmap -v
diff --git a/sources b/sources
index 3b7f79f..f12c8d2 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-520935ccc46b01a09956af8bfa63fa03 javapackages-0.5.0.tar.xz
+fbd80ff0430bececc5ed729ecb361fe9 javapackages-0.6.0.tar.xz
11 years, 11 months
[javapackages] Implement %pom_add_plugin
by Mikolaj Izdebski
commit 9b83bfdb6db2696728537056ff43967333b17b70
Author: Mikolaj Izdebski <mizdebsk(a)redhat.com>
Date: Mon Jul 30 14:49:04 2012 +0200
Implement %pom_add_plugin
macros.fjava | 28 ++++++++++++++++++++++++++--
scripts/pom_editor.sh | 10 ++++++++++
2 files changed, 36 insertions(+), 2 deletions(-)
---
diff --git a/macros.fjava b/macros.fjava
index 5969e26..21337b2 100644
--- a/macros.fjava
+++ b/macros.fjava
@@ -330,9 +330,9 @@ fi \
# %pom_add_dep[_mgmt] - add dependency to POM file
#
-# Usage: %pom_add_dep groupId:artifactId[:version:[scope]] [POM location] \
+# Usage: %pom_add_dep groupId:artifactId[:version[:scope]] [POM location] \
# [extra XML]
-# %pom_add_dep_mgmt groupId:articId[:version:[scope]] [POM location] \
+# %pom_add_dep_mgmt groupId:articId[:version[:scope]] [POM location] \
# [extra XML]
#
# These macros patch specified POM file adding a dependency on given version of
@@ -356,3 +356,27 @@ fi \
}
%pom_add_dep_mgmt() %{expand: %{__pom_call}add_dep_mgmt %*
}
+
+
+# %pom_add_plugin - add plugin invocation to POM file
+#
+# Usage: %pom_add_plugin groupId:artifactId[:version] [POM location] \
+# [extra XML]
+#
+# This macro patches specified POM file adding plugin invocation of given
+# groupId and artifactId.
+#
+# groupId and artifactId are identifiers of Maven plugin artifact of which
+# invocation is to be added. groupId may be ommited, in which case value of
+# "org.apache.maven.plugins" is used as default. artifactId must be
+# specified. If version is not specified then default value of "any" is used.
+#
+# POM location can be either a full path to the POM file, or a path to the
+# directory containing pom.xml. If POM location is not given then pom.xml from
+# current working directory is used.
+#
+# Extra XML is additional XML code to be added into the <plugin> node. This
+# parameter can be ommited, in which case no extra XML is appended.
+#
+%pom_add_plugin() %{expand: %{__pom_call}add_plugin %*
+}
diff --git a/scripts/pom_editor.sh b/scripts/pom_editor.sh
index 5be153f..9cd3756 100644
--- a/scripts/pom_editor.sh
+++ b/scripts/pom_editor.sh
@@ -202,6 +202,7 @@ _pom_inject_gaid()
BEGIN { FS=":" }
{
+ if (!$1) { $1="org.apache.maven.plugins" }
print "<groupId>" $1 "</groupId>"
print "<artifactId>" $2 "</artifactId>"
if (!$3) { $3="any" }
@@ -302,3 +303,12 @@ pom_add_dep_mgmt()
_pom_inject_gaid "pom:project/pom:dependencyManagement" "${1}" "${2}" "dependency" "${3}"
set -x
}
+
+
+pom_add_plugin()
+{
+ set +x
+ _pom_initialize
+ _pom_inject_gaid "pom:project/pom:build/pom:plugins" "${1}" "${2}" "plugin" "${3}"
+ set -x
+}
11 years, 11 months
[javapackages] Implement %pom_add_dep and %pom_add_dep_mgmt
by Mikolaj Izdebski
commit 16d94ffdc16c31529ea70ea13145a842da885cf4
Author: Mikolaj Izdebski <mizdebsk(a)redhat.com>
Date: Mon Jul 30 14:37:07 2012 +0200
Implement %pom_add_dep and %pom_add_dep_mgmt
macros.fjava | 32 +++++++++++++++++++++++++++++++-
scripts/pom_editor.sh | 18 ++++++++++++++++++
2 files changed, 49 insertions(+), 1 deletions(-)
---
diff --git a/macros.fjava b/macros.fjava
index a89f31e..5969e26 100644
--- a/macros.fjava
+++ b/macros.fjava
@@ -300,7 +300,7 @@ fi \
# %pom_remove_parent - remove parent POM reference from POM file
#
-# Usage: %pom_add_parent [POM location]
+# Usage: %pom_remove_parent [POM location]
#
# This macro patches specified POM file removing reference to parent POM.
#
@@ -326,3 +326,33 @@ fi \
#
%pom_set_parent() %{expand: %{__pom_call}set_parent %*
}
+
+
+# %pom_add_dep[_mgmt] - add dependency to POM file
+#
+# Usage: %pom_add_dep groupId:artifactId[:version:[scope]] [POM location] \
+# [extra XML]
+# %pom_add_dep_mgmt groupId:articId[:version:[scope]] [POM location] \
+# [extra XML]
+#
+# These macros patch specified POM file adding a dependency on given version of
+# artifactId from groupId, with given scope (if any). %pom_add_dep adds the
+# dependency to <dependencies> XML node, while %pom_add_dep_mgmt adds it to
+# <dependencyManagement>.
+#
+# groupId and artifactId are identifiers of Maven artifact on which dependency
+# is to be added.. They must be specified. If version is not specified then
+# default value of "any" is used. If scope is not specified then no scope is
+# defined (Maven defaults to "compile" in this case).
+#
+# POM location can be either a full path to the POM file, or a path to the
+# directory containing pom.xml. If POM location is not given then pom.xml from
+# current working directory is used.
+#
+# Extra XML is additional XML code to be added into the <dependency> node. This
+# parameter can be ommited, in which case no extra XML is appended.
+#
+%pom_add_dep() %{expand: %{__pom_call}add_dep %*
+}
+%pom_add_dep_mgmt() %{expand: %{__pom_call}add_dep_mgmt %*
+}
diff --git a/scripts/pom_editor.sh b/scripts/pom_editor.sh
index 031660a..5be153f 100644
--- a/scripts/pom_editor.sh
+++ b/scripts/pom_editor.sh
@@ -284,3 +284,21 @@ pom_set_parent()
_pom_inject_gaid "pom:project" "${1}" "${2}" "parent" "${3}"
set -x
}
+
+
+pom_add_dep()
+{
+ set +x
+ _pom_initialize
+ _pom_inject_gaid "pom:project/pom:dependencies" "${1}" "${2}" "dependency" "${3}"
+ set -x
+}
+
+
+pom_add_dep_mgmt()
+{
+ set +x
+ _pom_initialize
+ _pom_inject_gaid "pom:project/pom:dependencyManagement" "${1}" "${2}" "dependency" "${3}"
+ set -x
+}
11 years, 11 months
[javapackages] Implement %pom_set_parent
by Mikolaj Izdebski
commit 9fef9fef72cc1d6d1fbd09bf3442e2dbfa38ec73
Author: Mikolaj Izdebski <mizdebsk(a)redhat.com>
Date: Mon Jul 30 14:03:00 2012 +0200
Implement %pom_set_parent
macros.fjava | 16 ++++++++++++++++
scripts/pom_editor.sh | 10 ++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/macros.fjava b/macros.fjava
index 9acabee..a89f31e 100644
--- a/macros.fjava
+++ b/macros.fjava
@@ -310,3 +310,19 @@ fi \
#
%pom_remove_parent() %{expand: %{__pom_call}remove_parent %*
}
+
+
+# %pom_set_parent - set parent POM reference in POM file
+#
+# Usage: %pom_set_parent groupId:artifactId[:version] [POM location]
+#
+# This macro patches specified POM file setting reference to parent POM to
+# specified groupId, artifactId and version.
+#
+# This macros first removes parent POM reference and then adds a new one. It's
+# (more or less) equivalent to call to %pom_remove_parent followed by
+# invocation of %pom_add_parent. See documentation for these macros for more
+# information about parameters.
+#
+%pom_set_parent() %{expand: %{__pom_call}set_parent %*
+}
diff --git a/scripts/pom_editor.sh b/scripts/pom_editor.sh
index 45b1062..031660a 100644
--- a/scripts/pom_editor.sh
+++ b/scripts/pom_editor.sh
@@ -274,3 +274,13 @@ pom_remove_parent()
_pom_disable_xpath "${1}" "//pom:project/pom:parent" "parent POM reference removed by maintainer"
set -x
}
+
+
+pom_set_parent()
+{
+ set +x
+ _pom_initialize
+ _pom_disable_xpath "${2}" "//pom:project/pom:parent" "parent POM reference replaced by maintainer"
+ _pom_inject_gaid "pom:project" "${1}" "${2}" "parent" "${3}"
+ set -x
+}
11 years, 11 months
[javapackages] Implement %pom_remove_parent
by Mikolaj Izdebski
commit eb57296d1099be248bc552597733558301de74d4
Author: Mikolaj Izdebski <mizdebsk(a)redhat.com>
Date: Mon Jul 30 13:49:36 2012 +0200
Implement %pom_remove_parent
macros.fjava | 14 ++++++++++++++
scripts/pom_editor.sh | 9 +++++++++
2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/macros.fjava b/macros.fjava
index 2deef6b..9acabee 100644
--- a/macros.fjava
+++ b/macros.fjava
@@ -296,3 +296,17 @@ fi \
#
%pom_add_parent() %{expand: %{__pom_call}add_parent %*
}
+
+
+# %pom_remove_parent - remove parent POM reference from POM file
+#
+# Usage: %pom_add_parent [POM location]
+#
+# This macro patches specified POM file removing reference to parent POM.
+#
+# POM location can be either a full path to the POM file, or a path to the
+# directory containing pom.xml. If POM location is not given then pom.xml from
+# current working directory is used.
+#
+%pom_remove_parent() %{expand: %{__pom_call}remove_parent %*
+}
diff --git a/scripts/pom_editor.sh b/scripts/pom_editor.sh
index 891731a..45b1062 100644
--- a/scripts/pom_editor.sh
+++ b/scripts/pom_editor.sh
@@ -265,3 +265,12 @@ pom_add_parent()
_pom_inject_gaid "pom:project" "${1}" "${2}" "parent" "${3}"
set -x
}
+
+
+pom_remove_parent()
+{
+ set +x
+ _pom_initialize
+ _pom_disable_xpath "${1}" "//pom:project/pom:parent" "parent POM reference removed by maintainer"
+ set -x
+}
11 years, 11 months
[javapackages] Implement %pom_add_parent
by Mikolaj Izdebski
commit 343412e668d97dbe81fdae3655f982aa969b6b17
Author: Mikolaj Izdebski <mizdebsk(a)redhat.com>
Date: Mon Jul 30 13:44:42 2012 +0200
Implement %pom_add_parent
macros.fjava | 24 ++++++++++++++++++++++++
scripts/pom_editor.sh | 18 +++++++++++++-----
2 files changed, 37 insertions(+), 5 deletions(-)
---
diff --git a/macros.fjava b/macros.fjava
index 9da36fa..2deef6b 100644
--- a/macros.fjava
+++ b/macros.fjava
@@ -272,3 +272,27 @@ fi \
#
%pom_xpath_inject() %{expand: %{__pom_call}xpath_inject %*
}
+
+
+# %pom_add_parent - add parent POM reference to POM file
+#
+# Usage: %pom_add_parent groupId:artifactId[:version] [POM location]
+#
+# This macro patches specified POM file adding a reference to parent POM with
+# specified groupId, artifactId and version.
+#
+# groupId and artifactId are identifiers of Maven group and artifact of the POM
+# to be referenced as parent POM. They must be specified. If version is not
+# specified then default value of "any" is used.
+#
+# POM location can be either a full path to the POM file, or a path to the
+# directory containing pom.xml. If POM location is not given then pom.xml from
+# current working directory is used.
+#
+# Note: If specified POM has already a reference to parent POM this macro will
+# not alter or remove it. Instead a second reference will be added. This is
+# usually not the expected behavior, so if you want to replace existing parent
+# POM reference, consider using %pom_set_parent macro instead.
+#
+%pom_add_parent() %{expand: %{__pom_call}add_parent %*
+}
diff --git a/scripts/pom_editor.sh b/scripts/pom_editor.sh
index 219e4c2..891731a 100644
--- a/scripts/pom_editor.sh
+++ b/scripts/pom_editor.sh
@@ -202,12 +202,11 @@ _pom_inject_gaid()
BEGIN { FS=":" }
{
- if (!$3) { $3="any" }
- if (!$4) { $4="compile" }
- print "<groupId>" $1 "</groupId>"
+ print "<groupId>" $1 "</groupId>"
print "<artifactId>" $2 "</artifactId>"
- print "<version>" $3 "</version>"
- print "<scope>" $4 "</scope>"
+ if (!$3) { $3="any" }
+ print "<version>" $3 "</version>"
+ if ($4) { print "<scope>" $4 "</scope>" }
}' <<<"${2}")
_pom_inject_xpath "${3}" "${1}" "<${4}> ${xml} ${5} </${4}>"
@@ -257,3 +256,12 @@ pom_xpath_inject()
_pom_inject_xpath "${3}" "${1}" "${2}"
set -x
}
+
+
+pom_add_parent()
+{
+ set +x
+ _pom_initialize
+ _pom_inject_gaid "pom:project" "${1}" "${2}" "parent" "${3}"
+ set -x
+}
11 years, 11 months
[javapackages] Implement _pom_inject_gaid()
by Mikolaj Izdebski
commit 7e5bc48b812f30cd533226029d940591c0348ef3
Author: Mikolaj Izdebski <mizdebsk(a)redhat.com>
Date: Mon Jul 30 13:22:11 2012 +0200
Implement _pom_inject_gaid()
scripts/pom_editor.sh | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/scripts/pom_editor.sh b/scripts/pom_editor.sh
index e84b7c1..219e4c2 100644
--- a/scripts/pom_editor.sh
+++ b/scripts/pom_editor.sh
@@ -190,6 +190,30 @@ EOF
}
+# Add a new XML element referencing given artifact.
+# $1 - XPath of parent node
+# $2 - groupId:artifactId[:version[:scope]]
+# $3 - POM location pattern
+# $4 - XML tag name
+# $5 - additional XML contents
+_pom_inject_gaid()
+{
+ local xml=$(awk '
+BEGIN { FS=":" }
+
+{
+ if (!$3) { $3="any" }
+ if (!$4) { $4="compile" }
+ print "<groupId>" $1 "</groupId>"
+ print "<artifactId>" $2 "</artifactId>"
+ print "<version>" $3 "</version>"
+ print "<scope>" $4 "</scope>"
+}' <<<"${2}")
+
+ _pom_inject_xpath "${3}" "${1}" "<${4}> ${xml} ${5} </${4}>"
+}
+
+
pom_remove_dep()
{
set +x
11 years, 11 months