Last active
March 12, 2018 16:33
-
-
Save gwsu2008/f190fd6135324d1f55bb109efd38f1d6 to your computer and use it in GitHub Desktop.
maven-tips.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting project version from pom.xml and save the version to a file | |
mvn com.smartcodeltd:release-candidate-maven-plugin:LATEST:version \ | |
-DoutputTemplate="PROJECT_VERSION={{ version }}" \ | |
-DoutputUri="file://\${project.basedir}/version.properties" | |
#Print project version | |
mvn -q -N org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \ | |
-Dexec.executable='echo' \ | |
-Dexec.args='${project.version}' | |
mvn -q -N org.codehaus.mojo:build-helper-maven-plugin:3.0.0:parse-version \ | |
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \ | |
-Dexec.executable='echo' \ | |
-Dexec.args='${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}' | |
# 3rd method | |
MAVEN_OPTS="\ | |
-Dorg.slf4j.simpleLogger.defaultLogLevel=INFO \ | |
-Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.help=INFO" \ | |
mvn -q help:evaluate -o -Dexpression=project.version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment