Generate Build Number Maven

Generate Build Number Maven

While working with maven project and if you are using any SCM as repository which is mandatory in any company then it’s required to generate build number dynamically when build new jar of the project. As this is very simple by using org.codehaus.mojo plugin in your maven pom.xml. I will be creating sample project where I am using git as reposiroty and javahonk Git is public repository you can use it without any issue. Sample maven project structure:

Generate Build Number Maven

  • You could download this project form Git here
  • Please add below to your maven pom.xml file:

  • Use maven command mvn install and once build is done you will see below jar with unique version in target folder:

Generate Build Number Maven

  • For more information please visit maven tutorial here

Leave a Reply

Your email address will not be published. Required fields are marked *