Re: Applying Jenkins build number

2018-11-24 Thread Matthieu BROUILLARD
Fine that you found your way. The only issue with the technics relying on injection of some external value is that they make your build not reproducible. It might not be an issue if those injections are only for intermediate builds and that you tag your build at some point in time with real X.Y.Z

Re: Applying Jenkins build number

2018-11-23 Thread Jochen Wiedmann
I believe I came up with a simple solution: My POM now looks like my.group.id ${revision} my-artifact-id 1.2${build.number} So, ${build.number} is empty by default, unless in Jenkins, where I define it as ".${env.BUILD_NUMBER}". Jochen On Thu, Nov 22,

RE: Applying Jenkins build number

2018-11-23 Thread Thiebaud, Christophe
cool -Original Message- From: Matthieu BROUILLARD Sent: Freitag, 23. November 2018 15:08 To: users@maven.apache.org; i...@soebes.de Subject: Re: Applying Jenkins build number You can also use jgitver (https://jgitver.github.io/) that was demoed at Devoxx this year to compute

Re: Applying Jenkins build number

2018-11-23 Thread Matthieu BROUILLARD
You can also use jgitver (https://jgitver.github.io/) that was demoed at Devoxx this year to compute automatically the project version, even for each commit. Using a jgitver configuration of false true true You can get the versions computed for each commit, for example 1.2.0-1,

Re: Applying Jenkins build number

2018-11-22 Thread Karl Heinz Marbaise
Hi, On 22/11/18 22:24, Francois MAROT wrote: The new way to deal with such situation is described here: https://maven.apache.org/maven-ci-friendly.html 0-SNAPSHOT 1.2.${revision} and let Jenkins run Maven like this mvn deploy -Drevision=${env.BUILD_NUMBER} (or maybe just $BUILD_NUMBER

Re: Applying Jenkins build number

2018-11-22 Thread Francois MAROT
The new way to deal with such situation is described here: https://maven.apache.org/maven-ci-friendly.html 0-SNAPSHOT 1.2.${revision} and let Jenkins run Maven like this mvn deploy -Drevision=${env.BUILD_NUMBER} (or maybe just $BUILD_NUMBER depending on the way you run Jenkins) -- Sent

Re: Applying Jenkins build number

2018-11-22 Thread Anders Hammar
Why not just update the pom (but not commit to scm) with a step like mvn versions:set -DnewVersion=$newVersion ? And newVersion you would parse from the pom file and add ${build.number} to it. /Anders On Thu, Nov 22, 2018 at 12:14 PM Jochen Wiedmann wrote: > Hi, > > when running Maven outside

Applying Jenkins build number

2018-11-22 Thread Jochen Wiedmann
Hi, when running Maven outside of Jenkins, I have the version number (for example) 1.2, which is just fine. However, within Jenkins I'd like that to be 1.2.${build.number}. Is that possible without overwriting the version number in the pom with every build? For example, by using a "jenkins"