1

我在我的项目中使用 Maven 构建。我在我们的本地网络中有一个公司关系存储库。此存储库通过 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)

我用谷歌搜索了一下,找到了一个在运行 maven build 时通过证书的解决方案。我下载了证书并使用 -Djavax.net.ssl.trustStore=Path/To/My/KeyStore 将其传递给 maven

命令行工具工作正常。但是,我仍然无法在 Eclipse 中使用 maven 构建项目。

Maven 不会从本地存储库下载新的依赖项。

提前感谢您的帮助!

普拉博德

4

1 回答 1

2

您的 Nexus 正在使用运行 Eclipse 的 Java 认为无效的 SSL 证书。这是因为 Nexus 中的证书未由受信任的根证书颁发机构(如 Verisign)签署。

您需要将 Nexus 中的公共证书安装到运行 Eclipse 的 Java 的 Java 信任库中以修复此问题,然后它将被信任。您可以使用我们的 import-ssl.jar 实用程序来帮助您,请参阅此处的第 24.2.3 节:

https://books.sonatype.com/nexus-book/reference/ssl-sect-client-cert.html

于 2015-06-29T23:50:46.290 回答