[GRADLE-2019] EAR plugin fails if JavaBasePlugin is applied before the EAR plugin (and JavaPlugin is not applied) Created: 30/Dec/11 Updated: 04/Jan/13 Resolved: 08/Feb/12 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 1.0-milestone-6 |
Fix Version/s: | 1.0-milestone-9 |
Type: | Bug | ||
Reporter: | Andrew Oberstar | Assignee: | René Gröschke (Inactive) |
Resolution: | Fixed | Votes: | 0 |
Description |
I need to apply the JavaBasePlugin in order to get some of the basic Gradle functionality (such as the build task) with an EAR project that does not use the JavaPlugin. The plugin makes an assumption that an project with the JavaPluginConvention available will also have a main source set. When you only apply the JavaBasePlugin you get the convention object, but the main source set isn't added until the JavaPlugin proper is applied. Due to an existing evaluation order dependency in the EAR plugin (marked as TODO on line 62 of EarPlugin.java), this can be worked around by applying the JavaBasePlugin after the EarPlugin. This plugin seems to need a little project.plugins.withType(JavaPlugin) { } magic. |