Why not just using version set
:
I assume you are using some CI like Jenkins.
- Create 3 parameters in your Jenkins (one for your branch:
feature
, develop
or release
), and one for the desired version, and one for your NEXT version. (of course your approach can be different).
- Clone your repository and the branch which you have specified as parameter.
- Based on the parameter you define
alpha
, beta
or rc
.
You can check 3.
in a sort of script. For example: When the checkout branch is release, set the environment variable CANDIDATE
with value rc
.
mvn -q -f ${POMPATH} versions:set -DnewVersion=${CANDIDATE}-${VERSION};
All versions in your pom will be set on rc-1.2.0
if you choose the release
branch and version is 1.2.0
.
Build your artifacts and push them to your nexus or Artifactory (or something like that). After that just do a new version set
without doing a commit on the previous changes and set only the $NEXTVERSION
without the CANDIDATE part.
Your artifacts will have names, dependent from the branch from which they are build, but without creating conflicts on the branches.
Of course there are a lot of approaches and I don't say you have to use this way of working, but I hope it can be useful in a way for you.