diff --git a/.travis/build-coveralls.sh b/.travis/build-coveralls.sh
index 4f2fcafb3c..c3834512a7 100755
--- a/.travis/build-coveralls.sh
+++ b/.travis/build-coveralls.sh
@@ -4,7 +4,7 @@ set -e
source .travis/logger.sh
source .travis/common-functions.sh
-VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:3.0.0:exec)
+VERSION=$(get_pom_version)
log_info "Building PMD Coveralls.io report ${VERSION} on branch ${TRAVIS_BRANCH}"
if ! travis_isPush; then
diff --git a/.travis/build-deploy.sh b/.travis/build-deploy.sh
index 75a03e0484..f4bbddc2d5 100755
--- a/.travis/build-deploy.sh
+++ b/.travis/build-deploy.sh
@@ -7,7 +7,7 @@ source .travis/github-releases-api.sh
source .travis/sourceforge-api.sh
source .travis/regression-tester.sh
-VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:3.0.0:exec)
+VERSION=$(get_pom_version)
log_info "Building PMD ${VERSION} on branch ${TRAVIS_BRANCH}"
MVN_BUILD_FLAGS="-B -V"
diff --git a/.travis/build-doc.sh b/.travis/build-doc.sh
index 2431635127..581fc64064 100755
--- a/.travis/build-doc.sh
+++ b/.travis/build-doc.sh
@@ -8,7 +8,7 @@ source .travis/sourceforge-api.sh
source .travis/pmd-code-api.sh
function main() {
- VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:3.0.0:exec)
+ VERSION=$(get_pom_version)
log_info "Building PMD Documentation ${VERSION} on branch ${TRAVIS_BRANCH}"
#
diff --git a/.travis/build-publish.sh b/.travis/build-publish.sh
index 6b25635bb2..5599103585 100644
--- a/.travis/build-publish.sh
+++ b/.travis/build-publish.sh
@@ -6,7 +6,7 @@ source .travis/common-functions.sh
source .travis/github-releases-api.sh
source .travis/sourceforge-api.sh
-VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:3.0.0:exec)
+VERSION=$(get_pom_version)
log_info "PMD Release ${VERSION}"
if ! travis_isPush; then
diff --git a/.travis/build-sonar.sh b/.travis/build-sonar.sh
index 71d2314e2f..36cc2cc6b4 100755
--- a/.travis/build-sonar.sh
+++ b/.travis/build-sonar.sh
@@ -4,7 +4,7 @@ set -e
source .travis/logger.sh
source .travis/common-functions.sh
-VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:3.0.0:exec)
+VERSION=$(get_pom_version)
log_info "Building PMD Sonar ${VERSION} on branch ${TRAVIS_BRANCH}"
if ! travis_isPush; then
diff --git a/.travis/common-functions.sh b/.travis/common-functions.sh
index e46731feb6..3148dd9796 100755
--- a/.travis/common-functions.sh
+++ b/.travis/common-functions.sh
@@ -53,3 +53,7 @@ function travis_isWindows() {
return 1
fi
}
+
+function get_pom_version() {
+ 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/pmd-doc/pom.xml b/pmd-doc/pom.xml
index 8e953090a2..3ab9d7e3a3 100644
--- a/pmd-doc/pom.xml
+++ b/pmd-doc/pom.xml
@@ -24,7 +24,6 @@
org.codehaus.mojo
exec-maven-plugin
- 3.0.0
generate-rule-docs
diff --git a/pom.xml b/pom.xml
index 062f361a90..b42b4cede0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -265,6 +265,11 @@
build-helper-maven-plugin
3.0.0
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 3.0.0
+
org.apache.maven.plugins
maven-source-plugin