我已经为此困扰了太久,所以我真的需要一些专家的帮助,他们可以解决这个问题。
我已经安装了 Sonatype Nexus 2.0.3 版,并将它作为我的 JavaEE、Glassfish 类应用程序的开发存储库,并配置了 maven settings.xml 以从 nexus 存储库中读取。其他所有 jar 都已正确下载和缓存,但每次涉及 org.eclipse.persistence.xxx 上的 jar 时,结果都失败了:
[WARNING] The POM for org.eclipse.persistence:eclipselink:jar:2.3.2 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:javax.persistence:jar:2.0.3 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:org.eclipse.persistence.jpa.modelgen.processor:jar:2.3.2 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:org.eclipse.persistence.core:jar:2.2.0-RC4 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:org.eclipse.persistence.jpa:jar:2.2.0-RC4 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:org.eclipse.persistence.jpa.modelgen:jar:2.2.0-RC4 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:org.eclipse.persistence.oracle:jar:2.2.0-RC4 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:org.eclipse.persistence.antlr:jar:2.2.0-RC4 is missing, no dependency information available
[WARNING] The POM for org.eclipse.persistence:org.eclipse.persistence.asm:jar:2.2.0-RC4 is missing, no dependency information available
...
[ERROR] Failed to execute goal on project xxx-ejb: Could not resolve dependencies for project xxx:xxx-ejb:ejb:1.0-SNAPSHOT: The following artifacts could not be resolved: org.eclipse.persistence:eclipselink:jar:2.3.2, org.eclipse.persistence:javax.persistence:jar:2.0.3, org.eclipse.persistence:org.eclipse.persistence.jpa.modelgen.processor:jar:2.3.2, org.eclipse.persistence:org.eclipse.persistence.core:jar:2.2.0-RC4, org.eclipse.persistence:org.eclipse.persistence.jpa:jar:2.2.0-RC4, org.eclipse.persistence:org.eclipse.persistence.jpa.modelgen:jar:2.2.0-RC4, org.eclipse.persistence:org.eclipse.persistence.oracle:jar:2.2.0-RC4, org.eclipse.persistence:org.eclipse.persistence.antlr:jar:2.2.0-RC4, org.eclipse.persistence:org.eclipse.persistence.asm:jar:2.2.0-RC4: Failure to find org.eclipse.persistence:eclipselink:jar:2.3.2 in http://localhost:8993/nexus/content/groups/myrepo/ was cached in the local repository, resolution will not be reattempted until the update interval of MyRepo has elapsed or updates are forced -> [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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :xxx-ejb
这是我配置 nexus 存储库(开源版本)的方式:
我创建了 EclipseLink 的代理:
存储库名称:EclipseLink Maven 存储库
类型:代理
存储库 ID:eclipselink
策略:快照
远程存储位置:http://download.eclipse .org/rt/eclipselink/maven.repo/
下载Remote Indexes: False
Repository Path URL: http://localhost:8993/nexus/content/repositories/ecliselink/
至于使用maven的repo,我自己创建了一个组以汇总必要的存储库:
组名称:我的存储库
组 ID:myrepo
在有序组存储库列表中,我有
:- Apache 快照
:- 中央
:- Codehaus Snapshots
:- EclipseLink Maven Repository (指的是之前创建的 EclipseLink 代理)
在我的 pom.xml 中,依赖的片段如下:
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.0.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
<version>2.3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.appclient</groupId>
<artifactId>gf-client</artifactId>
<version>3.1</version>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javaee</groupId>
<artifactId>javaee-api</artifactId>
<version>5</version>
<scope>provided</scope>
</dependency>
在 maven settings.xml 文件中,镜像定义为:
<mirror>
<id>MyRepo</id>
<name>My Repository</name>
<url>http://localhost:8993/nexus/content/groups/myrepo/</url>
<mirrorOf>*</mirrorOf>
</mirror>
只是为了测试其中一个罐子是否存在,我直接调用[这不是链接]http://download.eclipse.org/rt/eclipselink/maven.repo/org/eclipse/persistence/eclipselink/2.3.2 /eclipselink-2.3.2.jar 在浏览器中,jar 就在那里。但是,当我尝试从 [这不是链接]http://localhost:8993/nexus/content/repositories/eclipselink/org/eclipse/persistence/eclipselink/2.3.2/eclipselink-2.3 处的 nexus 获取 jar 时。 2.jar,它的404?!
我已经更新并修复了索引,但所有这些都无济于事。任何帮助都非常感谢。
谢谢你。