From 39eb79f58e720fc5f5b85bcf95da3bdff3cae280 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 5 May 2017 12:22:55 +0200 Subject: [PATCH] Fix build determining current version Only take the last line of the output. Current maven wrapper will output the current directy, later versions of the wrapper will output the wrapper version. --- .travis/build-push.sh | 2 +- .travis/release.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis/build-push.sh b/.travis/build-push.sh index 3dcdc04f72..95b5aa50ee 100644 --- a/.travis/build-push.sh +++ b/.travis/build-push.sh @@ -1,7 +1,7 @@ #!/bin/bash set -ev -VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec) +VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1) echo "Building PMD ${VERSION} on branch ${TRAVIS_BRANCH}" if [[ "$VERSION" != *-SNAPSHOT && "$TRAVIS_TAG" != "" ]]; then diff --git a/.travis/release.sh b/.travis/release.sh index b96a28817c..30ad12ce26 100644 --- a/.travis/release.sh +++ b/.travis/release.sh @@ -1,7 +1,7 @@ #!/bin/bash set -ev -RELEASE_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec) +RELEASE_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1) # Deploy to ossrh has already been done with the usual build. See build-push.sh