2017-10-13 1 views
0

私はこのようなbuild.gradleを持っている:"dependencies"コマンドが、1つの依存関係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 

はなぜ依存関係をFAILEDがありますか? は何が廃止されましたか?の代わりに 'implementation'を使用しますか?

私はまた、使用:

testImplementation 'junit:junit:4.12' 

を同じコマンドリターンはまだ一部FAILED:testCompileClasspathtestRuntimeClasspathを。

どうしてですか?

答えて

1

repositoriesブロックグラデルを定義していない場合、それは正しく解決されていないため、依存関係が表示され、FAILEDとマークされます(依存関係を取得できた場所は定義されていません)。

compileについては、implementationが見えるhereをご覧ください。

関連する問題