我尝试根据他们的指令运行lenskit-hello。当我运行./gradlew build
时,我收到错误
(base) Briennas-MBP:lenskit-hello-master briennakh$ ./gradlew build
:compileJava
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compileClasspath'.
> Could not resolve org.lenskit:lenskit-all:3.0-M3.
Required by:
:lenskit-hello-master 4.50.57 AM:unspecified
> Could not resolve org.lenskit:lenskit-all:3.0-M3.
> Could not get resource 'https://repo1.maven.org/maven2/org/lenskit/lenskit-all/3.0-M3/lenskit-all-3.0-M3.pom'.
> Could not GET 'https://repo1.maven.org/maven2/org/lenskit/lenskit-all/3.0-M3/lenskit-all-3.0-M3.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve org.lenskit:lenskit-all:3.0-M3.
> Could not get resource 'https://jcenter.bintray.com/org/lenskit/lenskit-all/3.0-M3/lenskit-all-3.0-M3.pom'.
> Could not GET 'https://jcenter.bintray.com/org/lenskit/lenskit-all/3.0-M3/lenskit-all-3.0-M3.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4.009 secs
我在MacOS莫哈韦10.14.6上使用的是Java 1.8.0_241(而且只安装了这一个)。我已经安装了最新的安全更新,然后重新启动了我的电脑。我已经在我的常规WiFi和手机的热点上尝试了这一点。
我按照已接受答案here中的说明,从https://repo1.maven.org/maven2/org/lenskit/lenskit-all/3.0-M2/lenskit-all-3.0-M2.pom
和https://oss.sonatype.org/content/repositories/snapshots/org/lenskit/lenskit-all/3.0-M2/lenskit-all-3.0-M2.pom
下载安全证书,并通过以下命令将它们添加到密钥库中(仅显示两个中的一个):
keytool -import -alias maven -file /Users/briennakh/Downloads/maven.cer -keystore
/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/jre/lib/security/cacerts
如果我查一下
keytool -list -keystore /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/jre/lib/security/cacerts | grep maven
它显示我的证书已经添加,maven, Mar 17, 2020, trustedCertEntry
,但是我在运行./gradlew build
时仍然得到同样的错误?
我还检查了openssl x509 -in /Users/briennakh/Downloads/maven.pem -text
以确保证书看起来正常。
2条答案
按热度按时间yacmzcpb1#
该SSL certificate不是自签名开始,因此不需要手动添加。请尝试重新安装Java或将备用安装位置设置为
$JAVA_HOME
,并使用默认的cacerts
文件。某些内容似乎已损坏,因为它不应该拒绝repo1.maven.org
的证书。ls -la $JAVA_HOME/jre/lib/security/cacerts
表示cacerts
应该有大约114757个字节。这将尝试SSL会话(不通过Java):
该项目还使用了相当过时的Gradle版本,例如:
eblbsuwk2#
这可能是网络相关的问题。我也遇到过同样的问题。我总是使用公司的VPN,而Gradle建设。所以,然后我尝试没有VPN它给我上面的错误。但改变连接到VPN,问题得到解决。检查Gradle sync failed: Cause: unable to find valid certification path to requested target on MacOS