Difference between compilation and runtime configurations in Gradle

My question is a bit common, but it is also related to Gradle.

Why do we need compilation and runtime configuration?

When I compile something, I need artifacts to convert my java classes to bytecode, so I need configuration compilation, but why do I need runtime configuration, do I need something else to run my application in the JVM?

Sorry if that sounds stupid, but I don't get it.

+55
dependencies configuration gradle
May 22 '13 at 20:23
source share
1 answer

In the most common case, artifacts needed at compile time are a subset of those needed at runtime. For example, let's say that a program called app uses the foo library, while foo uses the bar library internally. Then, compiling the app requires only foo , but it requires both foo and bar to run it. This is why, by default, everything you insert into the Gradle compile configuration also appears in the runtime configuration, but the opposite is not true.

+84
May 22 '13 at 20:40
source share



All Articles