我在我的项目中使用maven build。我在本地网络中有一个企业nexus存储库。此存储库托管在https。
上我正面临从eclipse访问此存储库的问题。
显示的错误是:
Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (execution: default-compile, phase: compile)
- CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.5.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor
for org.apache.maven.plugins:maven-compiler-plugin:jar:2.5.1: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 from https://
NexusServer/nexus/content/groups/CLM/ was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced. Original
error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 from/to nexus (https://NexusServer/nexus/content/groups/CLM/):
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.5.1:testCompile (execution: default-testCompile, phase: test-compile)
我google了一下,找到了一个在运行maven build时传递证书的解决方案。我下载了证书并使用-Djavax.net.ssl.trustStore = Path / To / My / KeyStore将其传递给maven
命令行工具运行正常。但是,我仍然无法在eclipse中使用maven构建项目。
Maven不会从本地存储库下载新的依赖项。
先谢谢你的帮助!
Prabodh
答案 0 :(得分:2)
您的Nexus使用的是SSL证书,运行Eclipse的Java认为该证书无效。这是因为Nexus中的证书未由受信任的根证书颁发机构(如Verisign)签名。
您需要将Nexus中的公共证书安装到运行Eclipse的Java的Java信任库中以修复此问题,然后才能信任它。您可以使用我们的import-ssl.jar实用程序来帮助您完成此操作,请参阅此处的第24.2.3节:
https://books.sonatype.com/nexus-book/reference/ssl-sect-client-cert.html