[GRADLE-1709] Default 'runtime' configuration in the Java plugin should not extend 'compile', or have an easy way to override default behaviour Created: 01/Aug/11 Updated: 23/Jan/13 Resolved: 23/Jan/13
|Resolution:||Not A Bug||Votes:||1|
By default, java plugin generates a set of dependency configurations (as pointed out here: http://www.gradle.org/java_plugin.html#tab:configurations ) where 'runtime' configuration extends 'compile' configuration. However, this default set up is hardly common. On opposite, 'compile' extending 'runtime' is something I have encountered quite a few times.
For instance, project may contain compile-time-only dependencies such as FindBugs (source code checker) or Lombok (javac integrated byte-code generation tool). In both cases, such tools often use compile-time-only annotations that help during the compilation phase, but are not needed during runtime.
In my opinion, neither 'runtime' nor 'compile' should extend each other, because that's very specific to the project.
Alternatively, there should be a simple (and documented) workaround that does not involve creating a custom configuration (e.g. 'myCompile'), because in most projects it is desirable to stick to conventional 'compile' and 'runtime' configuration naming.
Note: Trying to "override" the default extends-behaviour using 'compile.extendsFrom runtime' gives a circular dependency error. Any better way of doing this??
|Comment by Luke Daley [ 23/Jan/13 ]|
You can configure runtime to not extend compile by: