Release workflow with Maven and Nexus

Kenneth Blair February 18, 2014

1. Is there any way to setup Bamboo to make release versions follow the Maven version? Something along the lines of ${maven.version}-b${buildNumber}.

2. The artifacts need to be published to Nexus. Is the expected workflow here that the build plan publishes the artifacts or that a Deployment publishes the artifacts?

3. I haven't found any Nexus related plugins which is strange to me since it's so commonly used. Is the only option for tying promotions in Bamboo to promotions in Nexus with some sort of bash script to call their API?

1 answer

0 votes
LarsM
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2014

1) Sure, just add a plan variable like maven.version with value 1 and pass it to the maven task.

2) It depends on what you like more. I my opinion use a deployment project.

3) Use maven-release-plugin and SCM Information in your pom of your project. Then you just run mvn release:prepare and release:perform (see http://maven.apache.org/maven-release/maven-release-plugin/)

This is a interesting video from Jonathan Docklovic from Summit last Year about maven and releasing via Bamboo (http://www.youtube.com/watch?v=YIgX67c-2hQ&index=52&list=PLaD4FvsFdarR451b0HQXHinsFQTDY-MSg)

Kenneth Blair February 27, 2014

1. The information is already available in the POM, it should pull it from there not force manual entry. Fortunately I found a plugin that extracts that information into a variable. It works on a single branch, I haven't tested multiple simultaneous branches so I'm not sure it will work in practice.

2. Fair enough.

3. Maven doesn't handle promotion at all. So the release plugin doesn't really offer anything. It has to be done with tooling, such as a Nexus staging repository. The problem is I need to tie that to the versions in Bamboo. If I can't then Bamboo is essentially an expensive, less capable Jenkins.

I have some ideas on how I can accomplish that using shell scripts in Bamboo that curl the API in Nexus. The build can deploy to a Nexus staging repository and the deployment "environments" can promote it through while triggering the actual deployment as well. I was really hoping there would be integration in lieu of hacky bash scripting.

Oh well, thank you for your time.

LarsM
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 27, 2014

You can use the maven-nexus-plugin and run it in the release-plugin - see http://www.baeldung.com/maven-release-nexus

And then use a Maven2/3 Task to execute it.

Adam Pryce February 25, 2016

The problem is that Bamboo is using a cached repository, so even when using the maven-nexus-plugin, the plugin cannot push the commits with the release tag back to the repository (in my case Bitbucket Server).

Chandler Zhang
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 10, 2016

he problem is that Bamboo is using a cached repository, so even when using the maven-nexus-plugin, the plugin cannot push the commits with the release tag back to the repository (in my case Bitbucket Server).


Do you mean maven-release-plugin? Could you please provide some logs of your build? We use maven-release-plugin and don't have the problem

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events