gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 01:01:15 26 4
gpt4 key购买 nike

我的 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-

关于java - Gradle 无法从 Nexus 存储库获取依赖项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60600429/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com