Gradle dependencies


(Klaus Christiansen) #1

When I run
gradlew dependencies
i get somthing like
compile - Dependencies for source set 'main' (deprecated, use 'implementation ' instead).
and
runtime - Runtime dependencies for source set 'main' (deprecated, use 'runtimeOnly ' instead).
and
testCompile - Dependencies for source set 'test' (deprecated, use 'testImplementation ' instead).
and
testRuntime - Runtime dependencies for source set 'test' (deprecated, use 'testRuntimeOnly ' instead).

But what does this mean?? I havn’t declared any testRuntime dependencies.

Gradle version 3.4.1, Windows 7, 64bit and Java 8, 64bit


(Klaus Christiansen) #2

Does anyone know this?


(Dimitar Dimitrov) #3

Check out these links:

https://docs.gradle.org/3.4/release-notes.html#the-java-library-plugin
https://docs.gradle.org/3.4/userguide/java_library_plugin.html#sec:java_library_configurations_graph


(Jim Kelly) #4

I checked out the links, used the java-library plugin and the api and implementation configurations, but I’m still getting these deprecation warnings. Nothing in my build.gradle refers to compile or runtime.


(Chris Doré) #5

This is normal output of the dependencies task and does not necessarily indicate an issue with your build. The task lists all configurations, regardless of whether they have dependencies or not. The text, “deprecated, use ‘xyz’ instead”, is there for informational and guidance purposes.
Where it might indicate a future problem with your build is if you see dependencies in one of those deprecated configurations. In that case you should probably consider moving them to the suggested configuration.


(Jim Kelly) #6

Thanks for the reply, Chris. Yes, I would expect that message to show up if I’m using a deprecated config. But I’m not used to seeing such messages in other systems as perhaps-interesting bits of trivia if my code is clean.

As it stands I found the message confusing, esp for a gradle noob like myself, as it sent me into thinking I misunderstand something and have a precarious build. Which led me to badger people on the internet about it, and… well, here we are. I’d recommend suppressing the message.