Dependencies should no longer be declared using the "compile"and “runtime” configurations
不應再使用“compile”和“runtime”配置聲明依賴關係。
自從 Gradle 3.4 以後,已經放棄在 Java 生態系統插件中使用 compile
和 runtime
配置。
這些配置用於編譯和運行來自於 main
源碼集的代碼。其他的源碼集創建相似的配置(例如,用於 test
源碼集的 testCompile
和 testRuntime
),也不應該被使用。implementation
, api
, compileOnly
和 runtimeOnly
配置應該被用於聲明依賴,並且,compileClasspath
和 runtimeClasspath
配置用於解析依賴。
要了解更多關於各種配置之間的關係,敬請期待!