Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gradle difference between testRuntime and testProvided

Tags:

gradle

Single question:

In gradle, there are several configurations provided out of the box. For example testCompile, testProvided, testRuntime, javaCompile, javaProvided, and so on...

Could you explain what's the difference?

like image 894
Jordi Avatar asked Oct 19 '15 22:10

Jordi


Video Answer


1 Answers

Configurations allow you to scope dependencies. Given this configuration hierarchy:

testRuntime -> testCompile -> runtime -> compile

Each configuration helps you limit where your dependencies are. *Runtime configurations allow you to include a dependency, but not have it as a compile dependency. This is helpful when you want to keep a framework loosely coupled from a project. A runtime dependency means that you need it for the app to run, but don't need it to compile.

The same thing applies for the test* configurations.

Ref:

  • Gradle Docs - Dependency configurations
like image 111
Ethan Avatar answered Jan 03 '23 20:01

Ethan