My question is a little bit common, but it is linked with Gradle too.
Why we need compile and runtime configuration?
When I compile something I need artifacts to convert my java classes in bytecode so I need compile configuration, but why is needed runtime configuration do I need something else to run my application in JVM?
Sorry if it sounds stupid, but I don't understand.
In the most common case, the artifacts needed at compile time are a subset of those needed at runtime. For example, let's say that a program called
app
uses libraryfoo
, and libraryfoo
internally uses librarybar
. Then onlyfoo
is needed to compileapp
, but bothfoo
andbar
are needed to run it. This is why by default, everything that you put on Gradle'scompile
configuration is also visible on itsruntime
configuration, but the opposite isn't true.