Unable to resolve dependency for ':@debug/compileClasspath' || Could not download *.jar

本文介绍了当使用Gradle构建项目时遇到无法下载所需Jar文件的问题解决方案。通过检查并注释掉gradle.properties中的代理设置,可以恢复正常下载。对于特定Jar如junit.jar被墙的情况,建议添加mavenCentral()来确保下载成功。

    由于配置可用的仓库地址仍然下载不了需要的jar,怀疑设置了不可用代理导致网络不通,打开gradle.properties,里面确实设置了proxy,注销掉即可正常下载。

若是像Could not download junit.jar (junit:junit:4.12)报错,是因为被墙,加上mavenCentral()

[MVN] [INFO] ------------------------------------------------------------------------ [MVN] [ERROR] Failed to execute goal on project health-support: Could not resolve dependencies for project com.cmcc.ac:health-support:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at com.github.ulisesbocchio:jasypt-spring-boot-starter:jar:2.0.0: Failed to read artifact descriptor for com.github.ulisesbocchio:jasypt-spring-boot-starter:jar:2.0.0: Could not transfer artifact org.springframework.cloud:spring-cloud-dependencies:pom:Finchley.M8 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/springframework/cloud/spring-cloud-dependencies/Finchley.M8/spring-cloud-dependencies-Finchley.M8.pom: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1] [MVN] [ERROR] [MVN] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [MVN] [ERROR] Re-run Maven using the -X switch to enable full debug logging. [MVN] [ERROR] [MVN] [ERROR] For more information about the errors and possible solutions, please read the following articles: [MVN] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException java.lang.RuntimeException: ? Maven���ʧ�� at com.cmcc.ac.health.data.util.BuildPackageTool.executeMavenCommand(BuildPackageTool.java:178) at com.cmcc.ac.health.data.util.BuildPackageTool.OneModulePackage(BuildPackageTool.java:120) at com.cmcc.ac.health.data.util.BuildPackageTool.lambda$main$1(BuildPackageTool.java:92) at java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1590) at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java) at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1582) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) 15:47:54.826 [main] INFO com.cmcc.ac.health.data.util.BuildPackageTool - >>>>>>>>>>>>������ 15:47:54.826 [main] INFO com.cmcc.ac.health.data.util.BuildPackageTool - ===�������2��ģ�� 真的没有解决办法了嘛
最新发布
11-15
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值