0
我有一個build.gradle
這樣的:爲什麼「依賴關係」命令爲只有一個依賴關係的空項目JUnit返回一些「FAILED」結果?
apply plugin: 'java'
dependencies{
compile 'junit:junit:4.12'
}
,當我運行gradle dependencies
我得到:
------------------------------------------------------------
Root project
------------------------------------------------------------
apiElements - API elements for main. (n)
No dependencies
archives - Configuration for archive artifacts.
No dependencies
compile - Dependencies for source set 'main' (deprecated, use 'implementation ' instead).
\--- junit:junit:4.12 FAILED
compileClasspath - Compile classpath for source set 'main'.
\--- junit:junit:4.12 FAILED
compileOnly - Compile only dependencies for source set 'main'.
No dependencies
default - Configuration for default artifacts.
\--- junit:junit:4.12 FAILED
implementation - Implementation only dependencies for source set 'main'. (n)
No dependencies
runtime - Runtime dependencies for source set 'main' (deprecated, use 'runtimeOnly ' instead).
\--- junit:junit:4.12 FAILED
runtimeClasspath - Runtime classpath of source set 'main'.
\--- junit:junit:4.12 FAILED
runtimeElements - Elements of runtime for main. (n)
No dependencies
runtimeOnly - Runtime only dependencies for source set 'main'. (n)
No dependencies
testCompile - Dependencies for source set 'test' (deprecated, use 'testImplementation ' instead).
\--- junit:junit:4.12 FAILED
testCompileClasspath - Compile classpath for source set 'test'.
\--- junit:junit:4.12 FAILED
testCompileOnly - Compile only dependencies for source set 'test'.
No dependencies
testImplementation - Implementation only dependencies for source set 'test'. (n)
No dependencies
testRuntime - Runtime dependencies for source set 'test' (deprecated, use 'testRuntimeOnly ' instead).
\--- junit:junit:4.12 FAILED
testRuntimeClasspath - Runtime classpath of source set 'test'.
\--- junit:junit:4.12 FAILED
testRuntimeOnly - Runtime only dependencies for source set 'test'. (n)
No dependencies
爲何會出現在失敗依賴呢? 什麼是已棄用,請使用'執行'而不是是什麼意思?
我也用過:
testImplementation 'junit:junit:4.12'
但相同的命令返回仍然失敗部分:testCompileClasspath
和testRuntimeClasspath
。
這是怎麼發生的?