Skip to content

Commit

Permalink
Always use archive base name as the pom artifact id (#56447) (#56467)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed May 8, 2020
1 parent 45b5ca9 commit 8ae935b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,16 @@ class BuildPlugin implements Plugin<Project> {

/**Configuration generation of maven poms. */
static void configurePomGeneration(Project project) {
// have to defer this until archivesBaseName is set
project.afterEvaluate {
project.pluginManager.withPlugin('maven-publish') {
PublishingExtension publishing = project.extensions.getByType(PublishingExtension)
publishing.publications.withType(MavenPublication) { MavenPublication publication ->
publication.artifactId = project.convention.getPlugin(BasePluginConvention).archivesBaseName
}
}
}

project.plugins.withType(MavenPublishPlugin).whenPluginAdded {
TaskProvider generatePomTask = project.tasks.register("generatePom") { Task task ->
task.dependsOn 'generatePomFileForNebulaPublication'
Expand All @@ -375,7 +385,7 @@ class BuildPlugin implements Plugin<Project> {
}

project.tasks.withType(GenerateMavenPom).configureEach({ GenerateMavenPom pomTask ->
pomTask.destination = "${project.buildDir}/distributions/${project.convention.getPlugin(BasePluginConvention).archivesBaseName}-${project.version}.pom"
pomTask.destination = { "${project.buildDir}/distributions/${project.convention.getPlugin(BasePluginConvention).archivesBaseName}-${project.version}.pom" }
} as Action<GenerateMavenPom>)

PublishingExtension publishing = project.extensions.getByType(PublishingExtension)
Expand Down
8 changes: 0 additions & 8 deletions client/rest-high-level/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ apply plugin: 'elasticsearch.rest-resources'
group = 'org.elasticsearch.client'
archivesBaseName = 'elasticsearch-rest-high-level-client'

publishing {
publications {
nebula {
artifactId = archivesBaseName
}
}
}

restResources {
//we need to copy the yaml spec so we can check naming (see RestHighlevelClientTests#testApiNamingConventions)
restApi {
Expand Down
8 changes: 0 additions & 8 deletions client/rest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ sourceCompatibility = JavaVersion.VERSION_1_8
group = 'org.elasticsearch.client'
archivesBaseName = 'elasticsearch-rest-client'

publishing {
publications {
nebula {
artifactId = archivesBaseName
}
}
}

dependencies {
compile "org.apache.httpcomponents:httpclient:${versions.httpclient}"
compile "org.apache.httpcomponents:httpcore:${versions.httpcore}"
Expand Down
8 changes: 0 additions & 8 deletions client/sniffer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ sourceCompatibility = JavaVersion.VERSION_1_8
group = 'org.elasticsearch.client'
archivesBaseName = 'elasticsearch-rest-client-sniffer'

publishing {
publications {
nebula {
artifactId = archivesBaseName
}
}
}

dependencies {
compile project(":client:rest")
compile "org.apache.httpcomponents:httpclient:${versions.httpclient}"
Expand Down
8 changes: 0 additions & 8 deletions libs/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@ if (!isEclipse) {
}
}

publishing {
publications {
nebula {
artifactId = archivesBaseName
}
}
}

dependencies {
// This dependency is used only by :libs:core for null-checking interop with other tools
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
Expand Down
8 changes: 0 additions & 8 deletions modules/lang-painless/spi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ apply plugin: 'nebula.maven-scm'
group = 'org.elasticsearch.plugin'
archivesBaseName = 'elasticsearch-scripting-painless-spi'

publishing {
publications {
nebula {
artifactId = archivesBaseName
}
}
}

dependencies {
compile project(":server")
}
Expand Down
8 changes: 0 additions & 8 deletions x-pack/transport-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,3 @@ testingConventions {
}
}
}

publishing {
publications {
nebula(MavenPublication) {
artifactId = archivesBaseName
}
}
}

0 comments on commit 8ae935b

Please sign in to comment.