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

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 配置用于解析依赖。

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章