diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy index 440127c456247..4a08b8ed342a1 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy @@ -99,7 +99,7 @@ public class PluginBuildPlugin extends BuildPlugin { generatePOMTask.ext.pomFileName = "${project.archivesBaseName}-client-${project.versions.elasticsearch}.pom" } } else { - project.plugins.withType(MavenPublishPlugin).whenPluginAdded { + if (project.plugins.hasPlugin(MavenPublishPlugin)) { project.publishing.publications.nebula(MavenPublication).artifactId( project.pluginProperties.extension.name )