gpt4 book ai didi

java - Maven 没有使用 repo1,它将转到 maven.glassfish.org 并使我的构建失败

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:29:38 24 4
gpt4 key购买 nike

我有这个 repo 部分:

<repositories>
<repository>
<id>Repo1</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
</repository>
<repository>
<id>EclipseLink</id>
<url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
</repository>
</repositories>

和这个依赖:

    <dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.9.1</version>
<scope>compile</scope>
</dependency>

为什么 maven 不断地去 download.java.netmaven.glassfish.org ?它不在我的任何地方

Downloading: http://download.java.net/maven/glassfish//com/ocpsoft/prettyfaces-parent/3.3.3/prettyfaces-parent-3.3.3.pom
[INFO] Unable to find resource 'com.ocpsoft:prettyfaces-parent:pom:3.3.3' in repository Glassfish (http://download.java.net/maven/glassfish/)
Downloading: http://repo1.maven.org/maven2/com/ocpsoft/prettyfaces-parent/3.3.3/prettyfaces-parent-3.3.3.pom
8K downloaded (prettyfaces-parent-3.3.3.pom)
Downloading: http://download.java.net/maven/glassfish//com/ocpsoft/ocpsoft-parent/2/ocpsoft-parent-2.pom
[INFO] Unable to find resource 'com.ocpsoft:ocpsoft-parent:pom:2' in repository Glassfish (http://download.java.net/maven/glassfish/)
Downloading: http://repo1.maven.org/maven2/com/ocpsoft/ocpsoft-parent/2/ocpsoft-parent-2.pom
1K downloaded (ocpsoft-parent-2.pom)
Downloading: http://repo1.maven.org/maven2/com/sun/jersey/jersey-client/1.9.1/jersey-client-1.9.1.pom
6K downloaded (jersey-client-1.9.1.pom)
Downloading: http://repo1.maven.org/maven2/com/sun/jersey/jersey-project/1.9.1/jersey-project-1.9.1.pom
17K downloaded (jersey-project-1.9.1.pom)
Downloading: http://download.java.net/maven/2/net/java/jvnet-parent/1/jvnet-parent-1.pom
[INFO] Unable to find resource 'net.java:jvnet-parent:pom:1' in repository m2.java.net (http://download.java.net/maven/2)
Downloading: http://repository.jboss.org/nexus/content/groups/public//net/java/jvnet-parent/1/jvnet-parent-1.pom
[INFO] Unable to find resource 'net.java:jvnet-parent:pom:1' in repository repository.jboss.org (http://repository.jboss.org/nexus/content/groups/public/)
Downloading: http://maven.glassfish.org/content/groups/glassfish/net/java/jvnet-parent/1/jvnet-parent-1.pom
185b downloaded (jvnet-parent-1.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '6c9fd3d150b8a5f0ca676f49b8ed603793cabebb'; remote = '<html>
<head><title>301' - RETRYING
Downloading: http://maven.glassfish.org/content/groups/glassfish/net/java/jvnet-parent/1/jvnet-parent-1.pom
185b downloaded (jvnet-parent-1.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '6c9fd3d150b8a5f0ca676f49b8ed603793cabebb'; remote = '<html>
<head><title>301' - IGNORING
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: com.sun.jersey:jersey-project:pom:1.9.1

Reason: Cannot find parent: net.java:jvnet-parent for project: com.sun.jersey:jersey-project:pom:1.9.1 for project com.sun.jersey:jersey-project:pom:1.9.1

编辑:

作为调试步骤,我已经核对了 ~/.m2...我不知道发生了什么,但这个构建曾经工作过。

铁道部编辑:

好的,所以我应该提到,存储库部分在父 pom 中,依赖项在子 pom 中。如果我将配置放入一个大的 pom 中,它就可以工作。两个pom,它失败了。什么鬼??

更多编辑:

这绝对是疯狂的地方,maven 正在获取额外的存储库,我什至检查了 Artifact poms。无论如何,这是我对无法解释的行为的解决方案。将其放入我的 settings.xml 中:

<settings>
<mirrors>
<mirror>
<id>central-mirror</id>
<url>http://repo.maven.apache.org/maven2</url>
<mirrorOf>*,!eclipselink</mirrorOf>
</mirror>
</mirrors>
</settings>

这会强制 Maven 使用 central,除非我使用的是 eclipselink 存储库。叹息啊!

最佳答案

这绝对是疯狂的地方,maven 正在获取额外的存储库,我什至检查了 Artifact poms。无论如何,这是我对无法解释的行为的解决方案。将其放入我的 settings.xml 中:

<settings>
<mirrors>
<mirror>
<id>central-mirror</id>
<url>http://repo.maven.apache.org/maven2</url>
<mirrorOf>*,!eclipselink</mirrorOf>
</mirror>
</mirrors>
</settings>

这会强制 Maven 使用 central,除非我使用的是 eclipselink 存储库。这没有回答我的问题,但它是一种解决方法,无论出于何种疯狂的原因,maven 正在联系这些外部 repo 协议(protocol)。

关于java - Maven 没有使用 repo1,它将转到 maven.glassfish.org 并使我的构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16093428/

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