【备忘】gradle配置

官方文档(java相关):https://docs.gradle.org/current/userguide/userguide.html

官方网站下载二进制包并解压

移动到自己规划的目录

解压后目录下的init.d文件夹下创建init.gradle文件

将以下内容拷贝进去

allprojects {
    repositories {
        maven { url 'file:///D:/soft_files/repository'}
        mavenLocal()
        maven { name "Alibaba" ; url "https://maven.aliyun.com/repository/public" }
        mavenCentral()
    }

    buildscript { 
        repositories { 
            maven { name "Alibaba" ; url 'https://maven.aliyun.com/repository/public' }
            maven { name "M2" ; url 'https://plugins.gradle.org/m2/' }
        }
    }
}

使用IDEA新建gradle项目

在file>setting里做如下配置

编辑build.gradle文件

其中dependencies中的可用标签包括

As far as configurations go, the main ones of interest are:

  • compileOnly — for dependencies that are necessary to compile your production code but shouldn’t be part of the runtime classpath

  • implementation (supersedes compile) — used for compilation and runtime

  • runtimeOnly (supersedes runtime) — only used at runtime, not for compilation

  • testCompileOnly — same as compileOnly except it’s for the tests

  • testImplementation — test equivalent of implementation

  • testRuntimeOnly — test equivalent of runtimeOnly

You can learn more about these and how they relate to one another in the plugin reference chapter.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值