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

<configuration>
    <mavenLike>false</mavenLike>
    <autoIncrementPatch>true</autoIncrementPatch>
    <useCommitDistance>true</useCommitDistance>
</configuration>

You can get the versions computed for each commit, for example 1.2.0-1,
1.2.0-2, 1.2.0-3

Matthieu


On Fri, Nov 23, 2018 at 6:54 AM Karl Heinz Marbaise <khmarba...@gmx.de>
wrote:

> 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
> >
> > <properties>
> >      <revision>0-SNAPSHOT</revision>
> > </properties>
> >
> > <version>1.2.${revision}</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)
>
> Please add the configuration for flatten-maven-plugin to your
> configuration as described on the mentioned page...
>
> Kind regards
> Karl Heinz Marbaise
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

Reply via email to