博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
nexus发布工程版本问题总结
阅读量:2165 次
发布时间:2019-05-01

本文共 1712 字,大约阅读时间需要 5 分钟。

在发布工程开发版本,部署版本时,遇见两个问题,一个是配置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:* /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仓库,设置部署版本为允许重复发布。

你可能感兴趣的文章
对比学习用 Keras 搭建 CNN RNN 等常用神经网络
查看>>
深度学习的主要应用举例
查看>>
word2vec 模型思想和代码实现
查看>>
怎样做情感分析
查看>>
用深度神经网络处理NER命名实体识别问题
查看>>
用 RNN 训练语言模型生成文本
查看>>
RNN与机器翻译
查看>>
用 Recursive Neural Networks 得到分析树
查看>>
RNN的高级应用
查看>>
TensorFlow-7-TensorBoard Embedding可视化
查看>>
轻松看懂机器学习十大常用算法
查看>>
一个框架解决几乎所有机器学习问题
查看>>
特征工程怎么做
查看>>
机器学习算法应用中常用技巧-1
查看>>
机器学习算法应用中常用技巧-2
查看>>
通过一个kaggle实例学习解决机器学习问题
查看>>
决策树的python实现
查看>>
Sklearn 快速入门
查看>>
了解 Sklearn 的数据集
查看>>
用ARIMA模型做需求预测
查看>>