0

I want to add CI build number in my Maven created jar file. now my JAR file name is " XXX_5.0.0.jar" , but I want to create " XXX_5.0.0-100.jar" .

100 is the Build number from CI pipeline.

  • 1
    What kind of information can be the build number give any consumer of your jar? Usually if you are currently developing things the version is like `5.0.0-SNAPSHOT` if you want a reproducible state which means to create a release which is marked `5.0.0` ... – khmarbaise Sep 20 '21 at 19:22
  • What is your CI platform? Jenkins? Maybe this is what you are looking for: https://stackoverflow.com/questions/59160318/how-to-add-build-number-from-jenkins-to-jar-file – pleft Sep 20 '21 at 19:22
  • Duplicate of https://stackoverflow.com/questions/4238944/controlling-maven-final-name-of-jar-artifact? – kofemann Sep 20 '21 at 20:22
  • yes its working fine. @pleft , used sh''' mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version mvn versions:set -DnewVersion='${env.TAG_NAME}-${env.BUILD_NUMBER}' ''' – Doyel Kundu Sep 21 '21 at 12:59
  • Please read "[ask]". – the Tin Man Sep 28 '21 at 21:00

0 Answers0