gpt4 book ai didi

java - 为什么我的 Maven 指向旧的中央存储库 url?

转载 作者:行者123 更新时间:2023-12-03 23:19:20 25 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





How to force maven update?

(25 个回答)


4年前关闭。




我正面临通过 maven 安装下载依赖 jar 的问题。

从 Eclipse 控制台,我可以说 maven 正在尝试从旧的中央存储库 url 下载 jar:“https://repo.maven.apache.org/maven2”而不是“http://repo1.maven.org/maven2/

我的 pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxxx</groupId>
<artifactId>TestServices</artifactId>
<version>7.0.3.6</version>
<dependencies>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.0.2</version>
<scope>compile</scope>
</dependency>
</dependencies>

我的构建失败并显示以下错误消息:
[ERROR] Failed to execute goal on project 'xxxyyy': Could not resolve dependencies for project xxxyyy:jar:4.0.3.6: The following artifacts could not be resolved: org.codehaus:xstream:jar:1.3.1, gxs:ai:jar:0.5, javax.activation:activation:jar:1.0.2, com.oracle.jdbc:classes12:jar:9.2.0.5, org.eclipse.core:resources:jar:3.1.0, org.eclipse.core:runtime:jar:3.2.0.v20060603, org.eclipse.emf:common:jar:2.2.1.v200609210005, org.eclipse.emf:ecore:jar:2.2.1.v200609210005, org.eclipse.emf:ecore.xmi:jar:2.2.1.v200609210005, org.eclipse.equinox:common:jar:3.2.0.v20060603, org.eclipse:osgi:jar:3.2.1.R32x_v20060919, org.eclipse.wst.xml:core:jar:1.1.1.v200609210600, org.eclipse:xsd:jar:2.2.1.v200609210005, javax.mail:mail:jar:1.3.2, org.apache:log4j:jar:1.2.8: Failure to find org.codehaus:xstream:jar:1.3.1 in ${localRepo} was cached in the local repository, resolution will not be reattempted until the update interval of 'abcd' has elapsed or updates are forced -> [Help 1]

最佳答案

尝试添加这个

 <repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
</repositories>

并查看 Maven Repositories 的文档

并遵循文档:

存储库

The repository is one of the most powerful features of the Maven community. The default central Maven repository lives on https://repo.maven.apache.org/maven2/. Another source for artifacts not yet in iBiblio is the Codehaus snapshots repo.



Maven 存储库默认 Doc

关于java - 为什么我的 Maven 指向旧的中央存储库 url?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41620809/

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