Gradle difference between testRuntime and testProvided

Single question:

Gradle provides several configurations out of the box. For example testCompile , testProvided , testRuntime , javaCompile , javaProvided and so on ...

Could you explain what the difference is?

+5
source share
2 answers

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

 testRuntime -> testCompile -> runtime -> compile 

Each configuration helps you limit your dependencies. * Runtime configurations allow you to include a dependency, but not have it as a compilation dependency. This is useful if you want to keep the framework loosely related to the project. Runtime dependency means you need the application to run, but you do not need to compile it.

The same applies to test * configurations.

Ref:

+8
source

In addition to ethane, the answer: the provided configurations contain dependencies that are used at compile time but not packaged into the final artifact. This, for example, is useful when designing for a container that provides these dependencies when it is installed.

+2
source

Source: https://habr.com/ru/post/1234065/


All Articles