0
votes

Problem: we have a jenkins job that can 1) build the project (e.g. mvn package), and 2) the same job has Maven release build function enabled.

If I release, and I've not run a build immediately before I "perform maven release" I seem to risk applying the previous version to the tag.

E.g. I just released 0.0.2, and my head is at 0.0.3-SNAPSHOT. Again, I click perform maven release, and I'm offered the same versions again, not 0.0.3 / 0.0.4-SNAPSHOT.

Doing it by hand, I would always git pull, before mvn release:prepare release:perform.

So, in my view, jenkins too should git pull the repo first, before offering to set a version. Can this be done? It appears the jenkins release plugin ignores git settings in jenkins.

1
Why the down vote? It's a valid question about the m2 plugin behaviour. Is this more of a server fault type question? - Jepper
On second thought maybe it's not a good idea to pull before releasing. - Jepper

1 Answers

1
votes

I have similar Jenkins CI setup along with Git plugin but i did not face such issue.

Everytime project is build with the latest code from git repository.

If in your case projects are not building with latest code then you can add build setups to execute git commands in "Execute Windows Batch Command" to fetch the code from repository.