Maven plugin release issue

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 in Jenkins that use a plugin maven deploy

and upload artifacts to the Nexus repository. Since the same user can deploy snapshots, we can eliminate the user rights / permissions issue on the Nexus. (I was still giving the admin role to this user for testing)

POM parent

<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 verified that the /target/checkout/

Jenkins workspace contains the latest POM. Also added <distributionManagement>

inside the POM project



Now when I run the maven release plugin from Jenkins using mvn release:perform

I still get this:

Deployment failed: repository element was not specified in the POM inside 
distributionManagement element or in -DaltDeploymentRepository=id::layout
::url parameter

      



  • release:prepare

    no errors are displayed
  • SVN tag is generated as expected
  • Then during deployment it crashes with the above error
  • As I mentioned, snapshot deployments are frequent and error-free, so the settings.xml, distributionManagement and Nexus settings seem to be fine.
  • I can access http://myserver/repositories/releases

    manually
  • I checked with mvn help:effective-pom

    and mvn help:effective-settings

    and everything seems to be ok

Any ideas?

+3


source to share


1 answer


The error message is very explicit. There is no allocation management in your POM. This way you are potentially not inheriting from the parent pom.

Run

mvn help:effective-pom 

      



in the project you are trying to deploy and test. Or alternatively, take a look at an efficient POM in your IDE (Eclipse or whatever).

Then define the correct parent pom to use, or potentially insert the distribtionManagement segment as desired.

0


source







All Articles