You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by si...@apache.org on 2018/06/04 21:01:29 UTC
[bookkeeper] 08/10: Use maven-exec-plugin to get the maven project
version for CI jobs
This is an automated email from the ASF dual-hosted git repository.
sijie pushed a commit to branch branch-4.7
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
commit edeeb102f4acb08fa39ae6868c43ca3572bbacce
Author: Sijie Guo <si...@apache.org>
AuthorDate: Thu May 24 15:48:59 2018 -0700
Use maven-exec-plugin to get the maven project version for CI jobs
Descriptions of the changes in this PR:
*Motivation*
The current approach to get project version isn't reliable on CI environment. It might have garbage output (e.g. exceptions).
*Solution*
Changed to use `exec-maven-plugin` to echo `${project.vesion}`. It provides a more reliable approach to get version on CI environments.
Author: Sijie Guo <si...@apache.org>
Reviewers: Enrico Olivelli <eo...@gmail.com>
This closes #1437 from sijie/fix_getversion_problem
---
dev/common.sh | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dev/common.sh b/dev/common.sh
index d172d07..fb4be74 100644
--- a/dev/common.sh
+++ b/dev/common.sh
@@ -21,7 +21,11 @@
#
function get_bk_version() {
- bk_version=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '(^\[|Download\w+:)' 2> /dev/null`
+ bk_version=$(mvn -q \
+ -Dexec.executable="echo" \
+ -Dexec.args='${project.version}' \
+ --non-recursive \
+ org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
echo ${bk_version}
}
--
To stop receiving notification emails like this one, please contact
sijie@apache.org.