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 配置用於解析依賴。

要了解更多關於各種配置之間的關係,敬請期待!

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