【莹伙丛】Dependencies should no longer be declared using the compile and runtime configurations

自Gradle3.4起,compile和runtime配置已被弃用。本文介绍如何使用新的implementation, api, compileOnly及runtimeOnly配置声明依赖,以及如何利用compileClasspath和runtimeClasspath配置进行依赖解析。

Dependencies should no longer be declared using the "compile"and “runtime” configurations

不应再使用“compile”和“runtime”配置声明依赖关系。

自从 Gradle 3.4 以后,已经放弃在 Java 生态系统插件中使用 compileruntime 配置。

这些配置用于编译和运行来自于 main 源码集的代码。其他的源码集创建相似的配置(例如,用于 test 源码集的 testCompiletestRuntime ),也不应该被使用。implementation , api , compileOnlyruntimeOnly 配置应该被用于声明依赖,并且,compileClasspathruntimeClasspath 配置用于解析依赖。

要了解更多关于各种配置之间的关系,敬请期待!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值