I'm trying to publish the result of a build jenkins/maven to a Nexus repository.
The build is a war SNAPSHOT, here is the beginning of the POM :
<http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.elis</groupIenter code hered>
<artifactId>accueil_ce</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>accueil_ce</name>
I use clean install maven goals for the build.
I've installed and configure the Nexus Repository Manager Publisher plugin for jenkins so it can publish to my nexus Repo in a post build step.
The problem is :
if I configure the repo as 'snapshot' and 'allow redeploy' in Nexus, it doesnt appear in the list of repos available in Jenkins, when configuring the after build step 'Nexus Repository Manager Publisher' of the job.
if I configure the repos as 'release' and 'allow redeploy' in Nexus, then I got the following error when running the jenkins job :
java.io.IOException:com.sonatype.nexus.api.exception.RepositoryManagerException: Unable to upload component: Bad Request The version 0.0.1-SNAPSHOT does not match the repository policy!
I don't understand, there is no way to publish SNAPSHOTs to nexus from jenkins builds with this plugin ??
You need to add distribution management to you pom to control snapshot and release repos.
See https://maven.apache.org/pom.html#Distribution_Management and How to configure maven project to deploy both snapshot and releases to Nexus?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With