2015-11-12 26 views
1

我試圖將Hudson與Nexus整合。 由於我在不使用Nexus的情況下構建項目,因此其構建成功。Nexus不通過Hudson下載文物

當我試着使用的Nexus構建它,我得到以下編譯錯誤:

Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 12:22:22-0300) 
Maven home: /var/lib/hudson/maven/slavebundle/bundled-maven 
Java version: 1.7.0_91, vendor: Oracle Corporation 
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91.x86_64/jre 
Default locale: pt_BR, platform encoding: UTF-8 
OS name: "linux", version: "2.6.32-220.el6.x86_64", arch: "amd64", family: "unix" 

SLF4J: Class path contains multiple SLF4J bindings. 
SLF4J: Found binding in [jar:file:/var/lib/hudson/maven/slavebundle/lib/maven3-eventspy-runtime.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in [jar:file:/var/lib/hudson/maven/slavebundle/bundled-maven/lib/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 



[DEBUG] Connected to remote 
[INFO] o.h.m.e.h.SettingsBuildingRequestHandler - Using settings document ID: ff56412a-102c-4256-80bf-f234990c91ba 

[INFO] Scanning for projects... 

[INFO] 

[INFO] ------------------------------------------------------------------------ 
[INFO] Building Project 
[INFO] ------------------------------------------------------------------------ 
Downloading: http://localhost:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom 

[WARNING] The POM for org.apache.maven.plugins:maven-clean-plugin:jar:2.5 is missing, no dependency information available 
Downloading: http://localhost:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 1.378s 
[INFO] Finished at: Thu Nov 12 11:37:31 BRST 2015 
[INFO] Final Memory: 7M/30M 
[INFO] ------------------------------------------------------------------------ 
[INFO] o.h.m.e.h.MavenExecutionResultHandler - Build failed with exception(s) 
[INFO] o.h.m.e.h.MavenExecutionResultHandler - [1] org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Could not find artifact org.apache.maven.plugins:maven-clean-plugin:jar:2.5 in nexus (http://localhost:8081/nexus/content/groups/public) 
[DEBUG] Closing connection to remote 
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Could not find artifact org.apache.maven.plugins:maven-clean-plugin:jar:2.5 in nexus (http://localhost:8081/nexus/content/groups/public) -> [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/PluginResolutionException 
[DEBUG] Waiting for process to finish 
[DEBUG] Result: 1 
[DEBUG] Skipping watched dependency update for build: Tracker #26 due to result: FAILURE 
Finished: FAILURE 

這是哈德森我的配置設置:

<settings> 
    <mirrors> 
    <mirror> 
     <!--This sends everything else to /public --> 
     <id>nexus</id> 
     <mirrorOf>*</mirrorOf> 
     <url>http://localhost:8081/nexus/content/groups/public</url> 
    </mirror> 
    </mirrors> 
    <profiles> 
    <profile> 
     <id>nexus</id> 
     <!--Enable snapshots for the built in central repo to direct --> 
     <!--all requests to nexus via the mirror --> 
     <repositories> 
     <repository> 
      <id>central</id> 
      <url>http://central</url> 
      <releases><enabled>true</enabled></releases> 
      <snapshots><enabled>true</enabled></snapshots> 
     </repository> 
     </repositories> 
    <pluginRepositories> 
     <pluginRepository> 
      <id>central</id> 
      <url>http://central</url> 
      <releases><enabled>true</enabled></releases> 
      <snapshots><enabled>true</enabled></snapshots> 
     </pluginRepository> 
     </pluginRepositories> 
    </profile> 
    </profiles> 
    <activeProfiles> 
    <!--make the profile active all the time --> 
    <activeProfile>nexus</activeProfile> 
    </activeProfiles> 
    <servers> 
    <server> 
     <id>nexus</id> 
     <username>admin</username> 
     <password>admin123</password> 
    </server> 
    </servers> 
</settings> 

我不知道爲什麼會不從中央資源庫下載到nexus公共存儲庫。

有人可以對此有所瞭解嗎?

+0

您是否可以向互聯網公開以下載尚未存在於您的聯繫中的所需工件? – khmarbaise

+0

@khmarbaise是的,它是人。檢查與iptables關閉,仍然無法下載。我試着用沒有Nexus的Hudson在同一臺機器上運行,它像一個魅力一樣工作。如果Nexus在另一臺機器上,它也可以工作。所以我會盡量重新安裝一次。 –

+0

你在Nexus裏面檢查過代理配置嗎? – khmarbaise

回答

1

我終於解決了。當嘗試訪問中央存儲庫時,它被拋出爲SSL異常。

這個例外是自動阻止我的訪問。

我去了Central Repository> Configuration,並將遠程存儲位置url更改爲:http://repo.maven.apache.org/maven2/,並右鍵單擊Central並單擊Allow Proxy。

之後,它就像一個魅力。

我希望這可以幫助某人,因爲我幾乎失去了這兩天。

EDIT(19/11/2015):

如果你正在運行使用的是RedHat/CentOS的你的OpenJDK,有一個防止通過SSL訪問錯誤,正如指出的在評論部分@rseddon。變通辦法在這裏:https://issues.sonatype.org/browse/NEXUS-7999?focusedCommentId=306680&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-306680

如果你趕時間,這是我用了一個:

以下行添加到$ {JAVA_HOME} /jre/lib/security/java.security:

jdk.tls.disabledAlgorithms = EC,ECDHE,ECDH

現在我可以用我的中央回購的HTTPS鏈接。

+0

你是否在redhat/centos操作系統上運行openjdk?如果是這樣,有一個錯誤,防止它通過ssl訪問中央。看到這裏的解決方法:https://issues.sonatype.org/browse/NEXUS-7999?focusedCommentId=306680&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-306680 – rseddon

+0

我正在運行它在CentOs上。謝謝你,我會看看它。 –