2015-11-12 27 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上。谢谢你,我会看看它。 –