发布项目时,遇见了一下异常
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project ias-parent: Failed to deploy artifacts: Could not transfer artifact org.ias:ias-parent:pom:1.0.0.BUILD-20210414.081402-3 from/to snapshots (http://139.155.41.148:8081/repository/maven-snapshots/): Failed to transfer file http://139.155.41.148:8081/repository/maven-snapshots/org/ias/ias-parent/1.0.0.BUILD-SNAPSHOT/ias-parent-1.0.0.BUILD-20210414.081402-3.pom with status code 401
发布或者下包的时候,报4xx错误,几乎就是权限不足,下面我把可能遇到的问题总结一下,至于怎么解决,网上一大把,我就不多加赘述了.
1,maven文件设置错误
(1)ctrl+alt+s,搜索maven,配置的setting.xml是否正确
(2)软件使用的setting.xml与配置的不符合,我用的是idea,他会把配置的文件,复制一份到c盘,一般情况,在修改了之后,它会提示里import update ,如果遇见特殊情况,重启既可以解决
2.setting.xml配置错误
(1)setting.xml中,用户密码是否正确
(2)setting.xml中,的id是否和 中的id相同
(3)setting.xml中, Public是否和想要使用中的id相同
3.项目中的pom.xml错误
(1)需要发布时,pom.xml中是否添加了发布地址:
releases
releases
http://127.0.0.1:8000/repository/maven-releases/
snapshots
snapshots
http://127.0.0.1:8000/repository/maven-snapshots/
(2)发布地址中的id,是否和setting.xml中,中的id相同
(3)是否需要发布的每个模块的pom.xml都就行了正确配置.
ps:我的错误就是第(2),(3)条,特别第三条,卡了我很久…
4.nexus是否设置了允许相关操作
像下载,发布,重复发布,上传架包等等都有具体的权限设置,有可能需要修改
我还有一篇关于具体怎么配置nexus的文章,还有如何在nexus上传自己私有java架包,需要可以看一下