Gradle 无法从 Nexus 存储库获取依赖项?

Gradle can't get dependencies from nexus repository?

我想我的 jenkins 作业在尝试连接到 nexus 存储库时抛出此异常,有人对此有任何想法吗?我可以看到它在多个其他主题中被提及,但没有找到任何解决我的问题的方法。

The element type "hr" must be terminated by the matching end-tag "</hr>".
Could not resolve all files for configuration ':<dir>-web:xxx'.

以后

13:10:29  * What went wrong:
13:10:29  Execution failed for task ':xx-web:qqq'.
13:10:29  > Could not resolve all files for configuration ':xx-web:qqq'.
13:10:29     > Could not resolve mt.com.bbb.xx:xx-commons:0.0.9.
13:10:29       Required by:
13:10:29           project :xxx-web
13:10:29        > Could not resolve mt.com.bbb.xx:xx-commons:0.0.9.
13:10:29           > Could not parse POM http://<service>/repository/maven-public/.../xx-commons/0.0.9/xx-commons-0.0.9.pom
13:10:29              > The element type "hr" must be terminated by the matching end-tag "</hr>".

构建后我在缓存中看到这个文件 - (带有明显错误的 <\hr> 标记)

<html>
<head><title>308 Permanent Redirect</title></head>
<body>
<hr><center><h1>308 Permanent Redirect</h1></center>
</body>
</html>

当我尝试从主机简单地 wget 它时,我得到

root@jenkins-agent-t4dq3:/home/jenkins/workspace/# wget http://<url>/repository/maven-public/mt/com/xx/yy/0.0.9/yy-0.0.9.pom
--2020-03-10 06:40:14--  http://<url>/repository/maven-public/mt/com/xx/yy/0.0.9/xx-0.0.9.pom
Resolving <url> (<url>)... <ip>
Connecting to <url> (<url>)|<ip>|:80... connected.
HTTP request sent, awaiting response... 308 Permanent Redirect
2020-03-10 06:40:14 ERROR 308: Permanent Redirect.

您需要告诉 Gradle 回购位置 - 请注意,您需要弄清楚要使用的正确位置,localhost:8081 可能不正确:

repositories {
    maven {
          url "http://localhost:8081/nexus/content/groups/public"
    }
}

https://support.sonatype.com/hc/en-us/articles/213465358-How-do-I-configure-my-Gradle-build-to-download-artifacts-from-Nexus-