3

I have a build.gradle like this:

apply plugin: 'java'

dependencies{
   compile 'junit:junit:4.12'
}

and when I run gradle dependencies I get:

------------------------------------------------------------
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

Why are there the FAILED dependencies? And what does deprecated, use 'implementation' instead mean?

I also used:

testImplementation 'junit:junit:4.12'

but the same command returns still FAILED part: testCompileClasspath and testRuntimeClasspath.

Why is this happening?

Opal
  • 81,889
  • 28
  • 189
  • 210
acejazz
  • 789
  • 1
  • 7
  • 27

1 Answers1

2

If you haven't defined a repositories block gradle will print the dependency and marked it as FAILED, since it hasn't been resolved correctly (there was no placed defined from where the dependency could have been fetched).

When it comes to compile vs implementation have a look here please.

Opal
  • 81,889
  • 28
  • 189
  • 210