commit e245a1e09bf4fa76766f82ca214ea705b8c8076e Author: Mikolaj Izdebski mizdebsk@redhat.com Date: Mon Jul 30 11:27:49 2012 +0200
Support POMs with no groupId specified
In some cases there is no groupId specified explictly in POM file.
scripts/pom_editor.sh | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) --- diff --git a/scripts/pom_editor.sh b/scripts/pom_editor.sh index f93323a..e84b7c1 100644 --- a/scripts/pom_editor.sh +++ b/scripts/pom_editor.sh @@ -159,10 +159,23 @@ _pom_disable_gaid() local what=$(sed 's/[^ ]*://' <<<"${1}") local gid=$(sed -e 's/:[^:]*//' -e "s/..*/[text()='&']/" <<<"${2}") local aid=$(sed -e 's/[^:]*://' -e "s/..*/[text()='&']/" <<<"${2}") + local extra="" + + # Support cases with no groupId specified + if test -z "${gid}"; then + extra=' + <xsl:template match="//'"${1} [pom:artifactId${aid}]"'"> + xsl:comment + xsl:text '"${what}"' disabled by maintainer: </xsl:text> + <xsl:apply-templates select="pom:artifactId"/> + xsl:text </xsl:text> + </xsl:comment> + </xsl:template>' + fi
- # TODO: support cases with no groupId specified _pom_patch "${3}" <<EOF ${_pom_xslt_header} + ${extra} <xsl:template match="//${1} [pom:groupId${gid} and pom:artifactId${aid}]"> xsl:comment xsl:text ${what} disabled by maintainer: </xsl:text>