2012-04-06 70 views
0

由於這個問題已經讓我頭疼得太久了,所以我確實需要一些專家幫助解決這個問題。在Sonatype Nexus和EclipseLink中需要幫助Maven Repo代理

我已經安裝了Sonatype Nexus ver 2.0.3,我將它作爲JavaEE,Glassfish類應用程序的開發存儲庫,並已配置maven settings.xml以從nexus repo中讀取。每隔罐子被正確地下載並緩存,但每次當它涉及到對org.eclipse.persistence.xxx罐,它與結果失敗:

[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/
下載遠程索引:假
庫路徑URL:http://localhost:8993/nexus/content/repositories/ecliselink/


至於回購的使用Maven的,我創建了一個組忍下了必要的回購:
組名稱:我的倉庫
組ID:myrepo
在有序組庫列表,我有
: - 阿帕奇快照
: - 中央
: - Codehaus的快照
: - 的EclipseLink Maven倉庫(這是指先前創建的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> 

在行家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 [這不是鏈接] http:// localhost:8993/nexus/content/repositories/eclipselink/org/eclipse/persistence/eclipselink/2.3.2/eclipselink-2.3獲取jar的jar文件時。 2.jar,它的404?!

我已更新和修復索引,但所有這些都無濟於事。任何幫助是真正的讚賞。

謝謝。

回答

1

EclipseLink存儲庫的根目錄提供了404錯誤(而不是鏈接特定的jar時)。這種奇怪的行爲可能是問題的根源,Nexus無法索引存儲庫。

嘗試使用這樣的鏡子:

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

而且還要檢查此相關的問題

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

+0

嗨Jordeu, 事實上,在我發佈之前,我已經閱讀了關於此主題的其他問題。是的,我試過http://linorg.usp.br/eclipse/rt/eclipselink/maven.repo/,修復並更新了myrepo組中的索引。我甚至將eclipselink和org.eclipse.persistence.jpa.modelgen.processor分別下載到版本2.3.0而不是2.3.2,但結果仍然相同。 我也試着按照這個頁面的建議:https://bugs.eclipse.org/bugs/show_bug.cgi?id = 371255,並嘗試過http://maven.eclipse.org/nexus/content/庫/ Sonatype的/。所有這些都得出了同樣的結論。 – Max 2012-04-06 14:46:32

+1

Nexus無法索引此存儲庫,因爲它是p2格式,nexus OpenSource不支持該格式。如果您擁有Nexus Pro,那麼您對本存儲庫格式有本地支持。在OpenSource版本中,取消激活下載索引選項。您可以grep所有工件,但不能瀏覽nexus上的存儲庫。 – 2013-05-23 15:26:06

+0

@elton,即使停用了索引,Nexus OSS也不能與p2一起使用。 – 2013-09-26 10:46:33

3

我發現它與 「核心項目」 太工程Maven倉庫網址:

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