1.首先IDEA要在该工程Settings中配置本地安装的Gradle,配好其home目录,注意目录到根目录即可,不要到bin一级,否则提示错误,无法使用:
2.配置好后会自动侦测Gradle项目,点击右下角自动引入依赖
3.有些依赖无法下载,右上角有提示选项,try again重试,也可点击查看详细日志,基本上是网络不通,因为缓存(cached xxx.jar)不到国外库的相应jar包导致:
4.Gradle默认配置在C盘下该用户下的.gradle目录,默认jar存放地址为C:\Users\(用户名)\.gradle\caches\modules-2\files-2.1,可参考博文https://blog.csdn.net/chwshuang/article/details/52261940手动下载添加到Gradle已生成的对应目录。
6.Gradle仓库配置:.gradle文件夹下添加脚本:
allprojects{
repositories {
def REPOSITORY_URL= 'http://maven.aliyun.com/nexus/content/groups/public/'all { ArtifactRepository repo->
if(repo instanceofMavenArtifactRepository){
def url=repo.url.toString()if (url.startsWith('http