[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


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.

Generated at Wed Jun 30 12:10:35 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.