Hello everyone,

As a developer I want to automatically release my maven multi pom project
(composed of several modules) so I can use any subversion repository commit
as a potential release.

The below command works perfectly for it (I really use "-DdryRun=true" so
far for my tests so far BTW to make sure this POC does not affect our
repository):
mvn --batch-mode release:prepare -DautoVersionSubmodules=true
-DreleaseVersion=2.3000.0 -DdevelopmentVersion=2.3001.0-SNAPSHOT

It will correctly set all dependencies to 2.3000.0 and it will make sure
the developer version will change to 2.3001.0. I want to increase as you
see only the middle number which for us is called "minor" version number. I
want to leave the first number to a constant of "2" because it will only be
increased following a marketing decision. I want to leave the last number
which we call "bug fix" as "0" because we want to make sure that one is
handled automatically in case there are express changes to be made to the
currently in production code.

I need help configuring Jenkins to issue a command like the above with few
modifications:
-Dtag=$JOB_NAME-$MAJOR_VERSION_NUMBER.$BUILD_NUMBER.0
-DautoVersionSubmodules=true
-DreleaseVersion=$MAJOR_VERSION_NUMBER.$BUILD_NUMBER.0
-DdevelopmentVersion=$MAJOR_VERSION_NUMBER.$(($BUILD_NUMBER+1)).0-SNAPSHOT

As you can see all I am trying to do is to release a multi pom project
(batch-mode) setting the version of all components to an expresion composed
of  hopefully Jenkins parameter $MAJOR_VERSION_NUMBER (=2 in my case), the
provided by Jenkins $BUILD_NUMBER variable and a fixed hardcoded "0". Then
I need to set the developer version to the same with the exception of the
minor number which should be calculated as $BUILD_NUMBER+1. The above
"$(($BUILD_NUMBER+1))" works in bash, not sure if jenkins will rely on the
shell for this exercise.

Could anybody help here with the Jenkins settings?

I tried to set the -DreleaseVersion and the -DdevelopmentVersion in the
"Release goals and options" from the "Build environment" section (Release
Version and Development version). I did not get what I was expecting
though. I had to manually add their expression values in "Perform Maven
Release" and at that point when I did a "Perform Maven release" it did go
through and I could see in the console the dryrun informing me of the
successful version change.

That test I had to do it with just one project. If I want to apply the same
in a multi module pom it will bring other errors apparently because jenkins
does not understand "../" relative path so I guess I will need to put my
root pom (using aggregator and not parent pom here) a level above the
included modules.

So that would be another area I will need to resolve as well.

I have read several strategies around but it looks like this is still an
unresolved problem.

Thanks in advance,

- Nestor

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to