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
最佳答案
您的 JDK 的 keystore 似乎不包含 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 的可选依赖项 - 您可能需要将该依赖项添加到插件中。
但我认为这可能是 keystore 。有一个小的 Java 类可以帮助您将证书导入 keystore :https://code.google.com/p/java-use-examples/source/browse/trunk/src/com/aw/ad/util/InstallCert.java - 您可以简单地使用 javac 编译它并使用远程 url 作为参数运行它。它将创建一个包含证书的 keystore 。
关于java - 没有代理就无法解决 Maven 依赖关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27368802/