gpt4 book ai didi

Maven 构建失败——DependencyResolutionException

转载 作者:行者123 更新时间:2023-12-03 15:31:18 25 4
gpt4 key购买 nike

我正在安装一个具有 Maven 依赖项的包,并在尝试清理它时收到 DependencyResolutionException。
克隆它后,我导航到该目录并运行以下命令以安装它,没有错误:

mvn install:install-file -Dfile=./lib/massbank.jar -DgroupId=massbank  -DartifactId=massbank -Dversion=1.0 -Dpackaging=jar
mvn install:install-file -Dfile=./lib/metfusion.jar -DgroupId=de.ipbhalle.msbi -DartifactId=metfusion -Dversion=1.0 -Dpackaging=jar
然后:
mvn clean package 
具有以下控制台输出:
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< MassBank2NIST:MassBank2NIST >---------------------
[INFO] Building MassBank2NIST 0.0.2-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.450 s
[INFO] Finished at: 2021-04-07T01:08:28-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project MassBank2NIST: Could not resolve dependencies for project MassBank2NIST:MassBank2NIST:jar:0.0.2-SNAPSHOT: Failed to collect dependencies at edu.ucdavis.fiehnlab.splash:core:jar:1.8: Failed to read artifact descriptor for edu.ucdavis.fiehnlab.splash:core:jar:1.8: Could not transfer artifact edu.ucdavis.fiehnlab.splash:core:pom:1.8 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [EBI (http://www.ebi.ac.uk/intact/maven/nexus/content/repositories/ebi-repo/, default, releases+snapshots), releases (http://gose.fiehnlab.ucdavis.edu:55000/content/groups/public, default, releases+snapshots)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
如有必要,我可以发布调试日志开关的输出,但它很长。我也可以发布 pom.xml,但是它根据我的要求引用了存储库。
我搜索过类似的帖子,但似乎没有一个包含相同系列或类似的错误。有人可以帮我破译这些错误吗?
谢谢!

最佳答案

您不必降级 Maven。这里发生的事情是,从 3.8.1 开始,Maven 带有一个默认配置来阻止所有 HTTP(不安全)存储库。最好的方法是升级您的存储库并使其安全(HTTPS)。
但是,您可以通过将此镜像添加到您的 ~/.m2/settings.xml 来告诉 Maven 允许从您的不安全存储库下载。 :

<mirror>
<id>insecure-repo</id>
<mirrorOf>external:http:*</mirrorOf>
<url>http://www.ebi.ac.uk/intact/maven/nexus/content/repositories/ebi-repo/</url>
<blocked>false</blocked>
</mirror>
设置 blockedfalse将解决您的问题。请注意,上面的代码片段假设存储库位于 www.ebi.ac.uk镜像所有不安全的 HTTP 存储库(这就是 external:http:* 的意思)。
您还可以取消阻止单个存储库。例如,JasperSoft 存储库是不安全的,我使用以下命令取消阻止它:
<mirror>
<id>jaspersoft-third-party-mirror</id>
<mirrorOf>jaspersoft-third-party</mirrorOf>
<url>http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/</url>
<blocked>false</blocked>
</mirror>

关于Maven 构建失败——DependencyResolutionException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66980047/

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