My versions:
- Maven 3.0.4
- Jenkins 1.499
- Nexus 2.2
- maven-release-plugin 3.2
- jdk 1.6
- AIX 6.1
settings.xml
<server>
<id>snapshots</id>
<username>deploy</username>
<password>pass123</password>
</server>
<server>
<id>releases</id>
<username>deploy</username>
<password>pass123</password>
</server>
I have a lot of builds running in Jenkins which use the maven deploy
plugin and upload artifacts to the Nexus repo. Since the same user is able to deploy snapshots we can eliminate user roles/permissions issue in Nexus. (I still gave admin role to this user for testing)
Company parent POM
<distributionManagement>
<repository>
<id>releases</id>
<url>http://myserver/repositories/releases</url>
<layout>default</layout>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://myserver/repositories/snapshots</url>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>
Project POM
<scm>
<connection>scm:svn:http://svnserver/tags/1.2.3</connection>
<developerConnection>scm:svn:http://svnserver/tags/1.2.3</developerConnection>
</scm>
I have confirmed the /target/checkout/
in the Jenkins workspace contains the latest POM. Also added <distributionManagement>
inside the project POM
Now when I run maven release plugin from within Jenkins using mvn release:perform
I am still getting this:
Deployment failed: repository element was not specified in the POM inside
distributionManagement element or in -DaltDeploymentRepository=id::layout
::url parameter
release:prepare
shows no errors- The SVN tag gets created as expected
- Then during deploy, it fails with the above error
- Like I mentioned, snapshot deployment happens frequently and without error, so settings.xml, distributionManagement and Nexus permissions all seem to be in order.
- I am able to access
http://myserver/repositories/releases
manually - I have checked with
mvn help:effective-pom
andmvn help:effective-settings
and things seem to be in order
Any ideas ?
mvn deploy
with a release version and a snapshot version. If you get the same results (fails only for a release version) this will pinpoint the error to connection/permissions/etc and not to therelease
plugin. – Sean Connollysudo
into your Jenkins box as the user it runs as and confirm you have the same problem (just trying to eliminiate factors from the table). Also also, can you confirm the settings.xml file you modified is actually being used, here's a question regarding this. – Sean Connolly[DEBUG] Reading global..
, I checked and its the correct settings. 2. Can't sudo - dont have access to the box 3. Mvn deploy I am going to try later. 4. I just tried to run the same everything for another maven project and guess what.. it works. So problem is narrowed down to a single multi-module project , which most likely means an error with the one of the POMs. – Pulak Agrawal