zoukankan      html  css  js  c++  java
  • nexus 配置文件到本地maven本地仓库 失败

    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,

    
    
  • 相关阅读:
    static关键字总结
    C、C++的内存分区与存储
    new、delete、malloc、free、realloc的区别
    Python3连接MySQL数据库之mysql-client
    Linux系统配置
    Windows环境下进行socket编程
    jQuery学习-事件之绑定事件(七)
    jQuery学习-事件之绑定事件(六)
    jQuery学习-事件之绑定事件(五)
    jQuery学习-事件之绑定事件(四)
  • 原文地址:https://www.cnblogs.com/zhian/p/12741577.html
Copyright © 2011-2022 走看看