diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/PrecommitPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/PrecommitPlugin.java index 3c6f9cb0883..15bc6f60dae 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/PrecommitPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/PrecommitPlugin.java @@ -66,10 +66,13 @@ public abstract class PrecommitPlugin implements Plugin { t.setDescription("Runs all non-test checks"); }); - project.getPluginManager().withPlugin("java", p -> { - project.getTasks().named(LifecycleBasePlugin.CHECK_TASK_NAME).configure(t -> t.dependsOn(precommit)); - project.getTasks().withType(Test.class).configureEach(t -> t.mustRunAfter(precommit)); - }); + project.getPluginManager() + .withPlugin( + "lifecycle-base", + p -> project.getTasks().named(LifecycleBasePlugin.CHECK_TASK_NAME).configure(t -> t.dependsOn(precommit)) + ); + project.getPluginManager() + .withPlugin("java", p -> project.getTasks().withType(Test.class).configureEach(t -> t.mustRunAfter(precommit))); } } }