1、在IDEA配置settings.xml
settings.xml内容如下:
需要注意的是两个箭头标记出来的id。要是嫌标记不够明显,我可以再加大
下面就是pom的配置了。
一开始我配置有问题,现在先把错误的列出来。
先报一个错误:repository element was not specified in the POM inside distributionManagement element or in DaltDeploymentRepository
直译:在POM里的distributionManagement或DaltDeploymentRepository元素内没有指明repository元素。
图中可以看出,distributionManagement指定的repository的三个元素,为什么会报这个错呢?
------------------------ 假装思考3秒钟 ------------------------------
原来是id有问题。pom.xml中配置的id一定要与settings.xml中配置的id相同(就是上图用箭头标记出来的id)。
修改上传的id后得:
以报错了:[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project duy-user: Failed to deploy artifacts: Could not transfer artifact com.dopp.voor:duy-user:pom:1.31.0-20170620.020558-8 from/to snapshots (http://dev-mvn.***.com/content/repositories/snapshots/): Failed to transfer file: http://dev-mvn.***.com/content/repositories/snapshots/com/dopp/voor/duy-user/1.31.0-SNAPSHOT/duy-user-1.31.0-20170620.020558-8.pom. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
权限有问题。
相关说明如有兴趣可查看本人的另一篇帖子:https://blog.csdn.net/fgx_123456/article/details/98874573。
好,原来是这个地址类型是group,是不能上传的。
可以上传的地址是下边的两个。
好,那就来修改地址吧。
这样再deploy,终于顺利完成了。