我只是将我们的nexus存储库迁移到新服务器,并更新了build.gradle以指向该服务器。

uploadArchives {
    repositories.mavenDeployer {
        setUniqueVersion(false)
        repository(url: "http://<tomcat2:8080>/nexus-webapp-1.9.2/content/repositories/releases") {
            authentication(userName: "username", password: "password")
        }
        snapshotRepository(url: "http://<tomcat2:8080>/nexus-webapp-1.9.2/content/repositories/snapshots"){
            authentication(userName: "username", password: "password")
        }
    }
}

现在uploadArchives任务失败,并显示以下错误:



我在tomcat2日志中看到401错误,但凭据很好。我可以使用这些凭据登录nexus webapp。

用户权限在nexus中也很好,因为当我将nexus URL指向旧服务器时它可以工作。

我还在/.m2/settings.xml中验证了nexus用户名和密码。

最佳答案

仅有两个可能的答案(根据自己的经验):

  • 检查存储库是否未默认为ReadOnly部署策略
  • 检查您的版本(您的回购是快照的发行版,您是否
    相应地正确命名版本)
  • 关于gradle - Gradle uploadArchives在新的链接URL上失败,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41849138/

    10-11 22:14
    查看更多