首页 技术 正文
技术 2022年11月19日
0 收藏 350 点赞 2,343 浏览 1286 个字

Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project maven_day02_dao: Failed to deploy artifacts: Could not transfer artifact com.itheima:maven_day02_dao:jar:1.0-20200420.150331-1 from/to Snapshots (http://localhost:8081/nexus/content/repositories/snapshots/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/snapshots/com/itheima/maven_day02_dao/1.0-SNAPSHOT/maven_day02_dao-1.0-20200420.150331-1.jar. Return code is: 401, ReasonPhrase: Unauthorized.

原因:我本地maven配置的id或账号或密码  验证 不通过。 最后看了下,原来是maven Id里面的配置的 和项目里面配置的snapshotRepository的id 不一样(maven里面的原来已经存在),然后只是在项目的pom中新增而已,结果是因为“区分大小写”。

nexus 配置文件到本地maven本地仓库步骤

1、在maven的Settings.Xml 文件中的 <servers> 节点下新增

  <server>
<id>releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>Snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>

在项目中的pom.xml文件project 节点下(一般放在最后面,可以具体细化到每个模块)

<distributionManagement>
<repository>
<id>releases</id>
<url>http://localhost:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>


id=snapshots 对应的Pom.xml中version中的编译类型,如<version>1.0-SNAPSHOT</version>

3、编译到nexus,


    					
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,120
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,592
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,437
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,208
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,844
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,929