nexus发布工程版本问题总结

在发布工程开发版本,部署版本时,遇见两个问题,一个是配置setting.xml和工程pom.xml文件的server的ID名称一致性问题,第二个是发布部署版本时,nexus不允许同一版本重复部署,这个需要进行设置。先解决如下。

1.setting.xml中的server便签中的ID属性值必须和pom.xml中的 <distributionManagement>  -》 <repository>下的ID保持一致,这是引导工程发布到nexus中的权限验证处理,如果不一致,会报错:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project *: Failed to deploy artifacts: Could not transfer artifact *:jar:1.0 from/to releases (http://10.1.81.199:8081/nexus/content/repositories/releases/): Failed to transfer file: http://10.1.81.199:8081/nexus/content/repositories/releases/com/cs2c/security-management-client* /1.0/*-1.0.jar. Return code is: 401, ReasonPhrase:Unauthorized.(在发布时未授权

所以,这两处ID要保持一致。

pom.xml

  


setting.xml





2.默认情况下,nexus中部署版本不允许重复发布,但是有时候因为某些改动,变更,需要在本次版本发布,所以就要把解决该问题。否则,无法重复发布该版本。

   [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
                  deploy (default-deploy) on project First2: Failed to deploy artifacts:
                 Could not transfer artifact com.myd.cn:First2:jar:1.0 from/to my-nexus-releases
                 (http://127.0.0.1:8081/nexus/content/repositories/releases):
                 Failed to transfer file: http://127.0.0.1:8081/nexus/content/repositories/releases/com/myd/cn/First2/1.0/First2-1.0.jar.
                Return code is: 400, ReasonPhrase: Bad Request. -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
    [ERROR]
    [ERROR] After correcting the problems, you can resume the build with the command
    [ERROR]   mvn <goals> -rf :First2


所以,进入nexus的releases仓库,设置部署版本为允许重复发布。


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值