Maven依赖项无法在没有代理的情况下解析

时间:2014-12-08 23:16:45

标签: java maven netbeans maven-2 maven-3

Maven似乎无法解决所需的依赖关系。 该系统不在代理服务器后面,因此我无法理解为什么它不会起作用:

C:\Program Files\Micro-Manager 64-bit\plugins\Micro-Manager>mvn install:install-
file -DgroupId=org.micromanager -Dversion=1.4.20-SNAPSHOT \ -Dpackaging=jar -Dar
tifactId=MMJ_ -Dfile=MMJ_.jar
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-w
ebdav-jackrabbit/1.0/wagon-webdav-jackrabbit-1.0.pom
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project org.openspim:SPIMAcquisition:1.0.0-SNAPSHOT (C:\Program Fi
les\Micro-Manager 64-bit\plugins\Micro-Manager\pom.xml) has 1 error
[ERROR]     Unresolveable build extension: Plugin org.apache.maven.wagon:wagon-w
ebdav-jackrabbit:1.0 or one of its dependencies could not be resolved: Failed to
 read artifact descriptor for org.apache.maven.wagon:wagon-webdav-jackrabbit:jar
:1.0: Could not transfer artifact org.apache.maven.wagon:wagon-webdav-jackrabbit
:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): sun.security.va
lidator.ValidatorException: PKIX path building failed: sun.security.provider.cer
tpath.SunCertPathBuilderException: unable to find valid certification path to re
quested target -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin
gException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti
onException
C:\Program Files\Micro-Manager 64-bit\plugins\Micro-Manager>mvn install:install-
file -DgroupId=org.micromanager -Dversion=1.4.20-SNAPSHOT \ -Dpackaging=jar -Dar
tifactId=MMJ_ -Dfile=MMJ_.jar

1 个答案:

答案 0 :(得分:1)

您的JDK的密钥库似乎不包含maven central的可信证书:

Could not transfer artifact org.apache.maven.wagon:wagon-webdav-jackrabbit
:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): sun.security.va
lidator.ValidatorException: PKIX path building failed: sun.security.provider.cer
tpath.SunCertPathBuilderException: unable to find valid certification path to re
quested target

另一种可能性是插件org.apache.maven.wagon不在settings.xml里面的pluginGroups中

第三个猜测是将文件复制到webdav(wagon插件)作为org.apache.maven.wagon的可选依赖项的插件:wagon-webdav-jackrabbit - 您可能需要将该依赖项添加到插件

但我认为它可能是密钥库。有一个小的Java类可以帮助您将证书导入密钥库:https://code.google.com/p/java-use-examples/source/browse/trunk/src/com/aw/ad/util/InstallCert.java - 您只需使用javac编译它并使用远程URL作为参数运行它。它将创建一个包含证书的密钥库。