0

I am uploading build from Jenkins into Nexus repository. In case a build is successful it is uploaded with an increased buildNumber from maven-metadata.xml which is stored on Nexus. However, sometimes our builds fail which means we do not upload anything to nexus. But the build number in Jenkins increased. We want to have buildNumber in Jenkins and Nexus consistent.

Example:

  • build#1 on Jenkins success (uploaded to Nexus as buildNumber 1)
  • build#2 on Jenkins failed (nothing uploaded to Nexus)
  • build#3 on Jenkins success (uploaded to Nexus as buildNumber 3)

Is it somehow customizable?

Edit: I am using gradle with Maven Publishing plugin

Adam
  • 884
  • 7
  • 29
  • The maven-metadata.xml files are not updated by Nexus during deployment, they are updated by Maven. Maven downloads the appropriate maven-metadata.xml files, updates them with new build numbers, and then redeploys them. I'd suggest taking a look at the request.log file in Nexus, you should see these uploads. – rseddon Jan 29 '18 at 13:38
  • We are using Gradle with Maven Publishing plugin. I cannot see an option to customize the buildNumber. Is it possible? – Adam Jan 30 '18 at 13:10

0 Answers0