首页 文章

Maven发布插件部署问题

提问于
浏览
3

我的版本:

  • Maven 3.0.4

  • 詹金斯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>

我在Jenkins中运行了很多使用 maven deploy 插件并将工件上传到Nexus repo的构建版本 . 由于同一用户能够部署快照,因此我们可以消除Nexus中的用户角色/权限问题 . (我仍然给这个用户提供管理员角色进行测试)

公司母公司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>

项目POM

<scm>
   <connection>scm:svn:http://svnserver/tags/1.2.3</connection>
   <developerConnection>scm:svn:http://svnserver/tags/1.2.3</developerConnection>
</scm>

我已经确认Jenkins工作区中的 /target/checkout/ 包含最新的POM . 还在项目POM中添加了 <distributionManagement>



现在,当我使用mvn release:perform 从Jenkins内部运行maven release插件时,我仍然得到这个:

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


  • release:prepare 显示没有错误

  • SVN标记按预期创建

  • 然后在部署期间,它失败并出现上述错误

  • 就像我提到的,快照部署经常发生且没有错误,因此settings.xml,distributionManagement和Nexus权限似乎都是有序的 .

  • 我可以手动访问 http://myserver/repositories/releases

  • 我已经检查了 mvn help:effective-pommvn help:effective-settings ,事情似乎是有序的

有任何想法吗 ?

1 回答

  • 0

    错误消息非常明确 . 您的POM中没有分配管理 . 所以你可能不会从父母pom中获取 .

    mvn help:effective-pom
    

    在您尝试部署和检查的项目中 . 或者在IDE中查看有效的POM(Eclipse或其他) .

    然后找出要使用的正确父pom或可能根据需要插入distribtionManagement段 .

相关问题