Nexus 不通过 Hudson 下载工件
Nexus not downloading artifacts through Hudson
我正在尝试将 Hudson 与 Nexus 集成。
当我在不使用 Nexus 的情况下构建项目时,它的构建是成功的。
当我尝试使用 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
这是我在 Hudson 上配置的设置:
<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 public 存储库。
有人可以解释一下吗?
我终于解决了。尝试访问中央存储库时抛出 SSL 异常。
此异常自动阻止了我的访问。
我转到中央存储库 > 配置并将远程存储位置 url 更改为:http://repo.maven.apache.org/maven2/ 并右键单击中央并单击允许代理。
在那之后它就像一个魅力。
我希望这对某人有所帮助,因为我为此浪费了将近两天的时间。
编辑(2015 年 11 月 19 日):
如果您 运行 您的 openjdk 使用 RedHat/CentOS,则存在阻止通过 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
现在我可以在我的 Central Repo 上使用 https link。
我正在尝试将 Hudson 与 Nexus 集成。 当我在不使用 Nexus 的情况下构建项目时,它的构建是成功的。
当我尝试使用 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
这是我在 Hudson 上配置的设置:
<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 public 存储库。
有人可以解释一下吗?
我终于解决了。尝试访问中央存储库时抛出 SSL 异常。
此异常自动阻止了我的访问。
我转到中央存储库 > 配置并将远程存储位置 url 更改为:http://repo.maven.apache.org/maven2/ 并右键单击中央并单击允许代理。
在那之后它就像一个魅力。
我希望这对某人有所帮助,因为我为此浪费了将近两天的时间。
编辑(2015 年 11 月 19 日):
如果您 运行 您的 openjdk 使用 RedHat/CentOS,则存在阻止通过 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
现在我可以在我的 Central Repo 上使用 https link。