only add validatePlugins task if java plugin is applied
@@ -19,7 +19,9 @@ public class PluginValidationPlugin implements Plugin<Project> {
@Override
public void apply(final Project project) {
- project.getPlugins().apply("java");
+ project.getPlugins().withId("java", new Action<Plugin>() {
+ @Override
+ public void execute(Plugin plugin) {
TaskMaker.task(project, "validatePlugins", PluginValidatorTask.class, new Action<PluginValidatorTask>() {
@Override
public void execute(PluginValidatorTask task) {
@@ -29,4 +31,6 @@ public class PluginValidationPlugin implements Plugin<Project> {
}
});
}
+ });
+ }
}
