Based on the infrastructure provided by the Versions plugin (see below), the Branch plugin rewrites SNAPSHOT versions (for both projects and dependencies) to include a branch name passed in as parameter. These artifacts can then be deployed to a Maven repo without any risk of interference.
The plugin would typically be invoked in the CI environment (Jenkins) before building the project. When invoked from Jenkins, the branch is available as $GIT_BRANCH
.
mvn com.clearcapital.maven.plugins:cc-branch-maven-plugin:1.0.0:branch -D branch=origin/CCP-1234
Below is the original description of the Versions plugin.
This is the versions-maven-plugin.
- Make sure
gpg-agent
is running. - Execute
mvn -B release:prepare release:perform
For publishing the site do the following:
cd target/checkout
mvn verify site site:stage scm-publish:publish-scm