From 59acd6d969c7bca48969bb554cf1ec7e00a917f2 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 16 Jul 2020 18:46:40 +0200 Subject: [PATCH] Revert "Use xmlint to get the pom version" This reverts commit 34f185b03a41e5df1ed52897cf279c0607dee181. --- .travis/common-functions.sh | 2 +- do-release.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis/common-functions.sh b/.travis/common-functions.sh index 9a8cf3c4b0..3148dd9796 100755 --- a/.travis/common-functions.sh +++ b/.travis/common-functions.sh @@ -55,5 +55,5 @@ function travis_isWindows() { } function get_pom_version() { - echo $(echo -e 'setns x=http://maven.apache.org/POM/4.0.0\ncat /x:project/x:version/text()' | xmllint --shell pom.xml | grep -v /) + echo $(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:3.0.0:exec) } diff --git a/do-release.sh b/do-release.sh index 64e5d147f2..25d5785ed3 100755 --- a/do-release.sh +++ b/do-release.sh @@ -25,7 +25,7 @@ echo "Releasing PMD" echo "-------------------------------------------" # see also https://gist.github.com/pdunnavant/4743895 -CURRENT_VERSION=$(echo -e 'setns x=http://maven.apache.org/POM/4.0.0\ncat /x:project/x:version/text()' | xmllint --shell pom.xml | grep -v /) +CURRENT_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:3.0.0:exec) RELEASE_VERSION=${CURRENT_VERSION%-SNAPSHOT} MAJOR=$(echo $RELEASE_VERSION | cut -d . -f 1) MINOR=$(echo $RELEASE_VERSION | cut -d . -f 2)