How to generate maven artifact with jenkins build number

3.2k Views Asked by At

I'm trying associate maven artifacts name with build number. ex: sample.1.0.0-snapshot.ear into sample.1.0.0-snapshot.buildnumber.ear

I have tried maven-buildnumber plugin but still no luck.

could anyone help me to do this.

1

There are 1 best solutions below

11
Suresh On

You can use the Versions Maven plugin by executing following command before any other maven targets after clean.

mvn versions:set -DnewVersion=sample.1.0.0-snapshot.$BUILD_NUMBER