Skip to content

Instantly share code, notes, and snippets.

@alces
Created July 7, 2017 06:11
Show Gist options
  • Save alces/ccb8fa701694b686699a6bab271652cd to your computer and use it in GitHub Desktop.
Save alces/ccb8fa701694b686699a6bab271652cd to your computer and use it in GitHub Desktop.
How to set unique version for each build in Maven

Put in pom.xml a variable version:

<version>${my.artifact.version}</version>

And set this variable in mvn command line:

mvn -Dmy.artifact.version=1.0-$(date +%Y%m%d%H%M%S) deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment