在Sonatype Nexus和EclipseLink Maven Repo Proxy方面需要帮助

时间:2012-04-06 10:15:37

标签: java java-ee maven eclipselink

这个问题已经让我头晕了太长时间,所以我真的需要一些专家帮助解决这个问题。

我已经安装了Sonatype Nexus ver 2.0.3,我将它作为我的JavaEE开发存储库,Glassfish类应用程序并配置了maven settings.xml以从nexus repo中读取。每个其他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 repo(开源版本)的方式:

我已经为EclipseLink创建了一个代理:
存储库名称:EclipseLink Maven存储库
类型:代理人
存储库ID:eclipselink
政策:快照
远程存储位置:http://download.eclipse.org/rt/eclipselink/maven.repo/
下载远程索引:错误 存储库路径网址:http://localhost:8993/nexus/content/repositories/ecliselink/


至于使用maven的回购,我已经创建了一个组来整理必要的回购:
组名:我的存储库
Group ID:myrepo
在Ordered Group Repository Lists中,我有 : - Apache快照
: - 中央
: - Codehaus快照
: - 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就在那里。但是当我尝试从nexus获取jar时[这不是链接] http:// localhost:8993 / nexus / content / repositories / eclipselink / org / eclipse / persistence / eclipselink / 2.3.2 / eclipselink-2.3。 2.jar,它的404?!

我已经更新并修复了索引,但所有这些都无济于事。真的很感激任何帮助。

谢谢。

2 个答案:

答案 0 :(得分:3)

我找到了一个与“Nexus”一起使用的maven存储库URL:

http://maven.eclipse.org/nexus/content/repositories/Sonatype/

答案 1 :(得分:1)

EclipseLink存储库的根目录产生404错误(不是在链接特定jar时)。这种奇怪的行为可能是问题的根源,而Nexus无法索引存储库。

尝试使用这样的镜像:

http://linorg.usp.br/eclipse/rt/eclipselink/maven.repo/

并查看相关问题

Where did the EclipseLink/Maven repository go to? (again)