Gradle Tips For Beginner

本文描述了解决Gradle项目中遇到的连接超时问题(connecttimeout)和SSL问题(SSLPeershutdown)的方法,包括更换国内镜像仓库下载Gradle,设置信任store,以及在Gradle中引入阿里云镜像。
摘要由CSDN通过智能技术生成

Issues: 

Connect time out

问题发生在刚打开gradle项目时,往往是gradle-wrapper.properties 文件中的地址连接超时导致。

fix: 用国内镜像仓库来下载. 

#Tue Mar 12 21:58:57 CST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
#distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip 
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.4-bin.zip #替换此处的url为国内镜像源(腾讯或者其他的)
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

SSL Peer shut down incorrectly

我这边是使用了代理,切换不同的代理再retry就ok了

Gradle:unable to find valid certification path to requested target

1. try to import the certificate.but no use for me, you can follow other article to try .

2.changed with two steps to fix the issues:

systemProp.javax.net.ssl.trustStore=NUL
systemProp.javax.net.ssl.trustStoreType=Windows-ROOT
  • add file ~/.gradle/init.gradle with below aliyun mirror, 

allprojects {
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/google/' }
}
}

repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/google/' }
}

println "${it.name}: Aliyun maven mirror injected"
}

  • 9
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值