commit eb57296d1099be248bc552597733558301de74d4 Author: Mikolaj Izdebski mizdebsk@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 +}