Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promoting a Maven build in a Jenkins Pipeline #202

Open
rhythmicdevil opened this issue Apr 22, 2020 · 2 comments
Open

Promoting a Maven build in a Jenkins Pipeline #202

rhythmicdevil opened this issue Apr 22, 2020 · 2 comments

Comments

@rhythmicdevil
Copy link

It is not clear to me, based on this documentation, exactly what I need to do to promote a maven build. To date, I've been using the Maven Release Plugin which has built in functionality to push the release to the release repository, create a new SNAPSHOT version number in the POM, and also to tag the release in the SCM. I assumed that the rtPromote and rtAddInteractivePromotion would provide the same features.

I have added the rtAddInteractivePromotion to a pipeline (see below). After a successful build there is now a little button that links to a screen to configure the promotion. Clicking the Promote Build button on that screen produces the following error.

Promoting build ....
Performing dry run promotion (no changes are made during dry run) ...

ERROR: Promotion failed during dry run (no change in Artifactory was done): HTTP/1.1 400 Bad Request
{
  "messages" : [ {
    "level" : "ERROR",
    "message" : "The repository 'libs-release-local' rejected the path 'com/etisoftware/jenkins-pipeline-test-project/1.1.0-SNAPSHOT/jenkins-pipeline-test-project-1.1.0-20200420.181826-4.jar' due to a conflict with its snapshot/release handling policy."
  }, {
    "level" : "INFO",
    "message" : "Skipping promotion status update: item promotion was completed with errors and warnings."
  } ]
}
ERROR: Promotion failed due to Artifactory response.
Completed

That seems to indicate that the version numbers are not being set by the closure.

What do I have to do exactly to get the same functionality as the Maven Release Plugin? Or, is there something else that I should be doing to make this work?

@eyalbe4
Copy link
Contributor

eyalbe4 commented Apr 23, 2020

@rhythmicdevil,

Build promotion in the context of Artifactory is defined as the action of copying or moving the artifacts (and optionally dependencies) of a build from one repository to another. The promotion action does not include changing the packages version.
There are two types of promotion supported: non-interactive and interactive promotion.

As for setting up a full release management for maven artifacts, which also includes modifying the version in the pom, it is currently supported only using the scripted suntax. You can reads more about this here. We would very much like to get your feedback about the existing release management support. We will be considering extending this to support declarative syntax as well, following more feedback received from the community.

@rhythmicdevil
Copy link
Author

Thanks for response. We have chosen to use the declarative pipeline syntax due to its flexibility. So we if we are to use this functionality it will have to be added there. I would suggest the closure designed to Maven releases does, at a minimum, what the Maven Release Plugin already does. I like the idea of having interactive version though. That was actually the one I chose to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants