[7.x] Re-add origin url information to publish POM files (#55173)
This commit is contained in:
parent
f7467a7fe8
commit
ce85063653
|
@ -65,6 +65,14 @@ if (VersionProperties.elasticsearch.toString().endsWith('-SNAPSHOT')) {
|
|||
}
|
||||
String elasticLicenseUrl = "https://raw.githubusercontent.com/elastic/elasticsearch/${licenseCommit}/licenses/ELASTIC-LICENSE.txt"
|
||||
|
||||
configure(allprojects - project(':distribution:archives:integ-test-zip')) {
|
||||
project.pluginManager.withPlugin('nebula.maven-base-publish') {
|
||||
if (project.pluginManager.hasPlugin('elasticsearch.build') == false) {
|
||||
throw new GradleException("Project ${path} publishes a pom but doesn't apply the build plugin.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
// Default to the apache license
|
||||
project.ext.licenseName = 'The Apache Software License, Version 2.0'
|
||||
|
|
|
@ -156,7 +156,6 @@ if (project == rootProject) {
|
|||
if (project != rootProject) {
|
||||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
allprojects {
|
||||
targetCompatibility = 10
|
||||
|
|
|
@ -28,6 +28,7 @@ import org.apache.commons.io.IOUtils
|
|||
import org.elasticsearch.gradle.info.BuildParams
|
||||
import org.elasticsearch.gradle.info.GlobalBuildInfoPlugin
|
||||
import org.elasticsearch.gradle.info.JavaHome
|
||||
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
|
||||
import org.elasticsearch.gradle.precommit.DependencyLicensesTask
|
||||
import org.elasticsearch.gradle.precommit.PrecommitTasks
|
||||
import org.elasticsearch.gradle.test.ErrorReportingTestListener
|
||||
|
@ -43,6 +44,7 @@ import org.gradle.api.NamedDomainObjectContainer
|
|||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.Task
|
||||
import org.gradle.api.XmlProvider
|
||||
import org.gradle.api.artifacts.Configuration
|
||||
import org.gradle.api.artifacts.Dependency
|
||||
import org.gradle.api.artifacts.ModuleDependency
|
||||
|
@ -390,6 +392,7 @@ class BuildPlugin implements Plugin<Project> {
|
|||
shadow.component(publication)
|
||||
// Workaround for https://github.com/johnrengelman/shadow/issues/334
|
||||
// Here we manually add any project dependencies in the "shadow" configuration to our generated POM
|
||||
publication.pom.withXml(this.&addScmInfo)
|
||||
publication.pom.withXml { xml ->
|
||||
Node dependenciesNode = (xml.asNode().get('dependencies') as NodeList).get(0) as Node
|
||||
project.configurations.getByName(ShadowBasePlugin.CONFIGURATION_NAME).allDependencies.each { dependency ->
|
||||
|
@ -405,6 +408,20 @@ class BuildPlugin implements Plugin<Project> {
|
|||
generatePomTask.configure({ Task t -> t.dependsOn = ['generatePomFileForShadowPublication'] } as Action<Task>)
|
||||
}
|
||||
}
|
||||
|
||||
// Add git origin info to generated POM files
|
||||
project.pluginManager.withPlugin('nebula.maven-base-publish') {
|
||||
PublishingExtension publishing = project.extensions.getByType(PublishingExtension)
|
||||
MavenPublication nebulaPublication = (MavenPublication) publishing.publications.getByName('nebula')
|
||||
nebulaPublication.pom.withXml(this.&addScmInfo)
|
||||
}
|
||||
}
|
||||
|
||||
private static void addScmInfo(XmlProvider xml) {
|
||||
Node root = xml.asNode()
|
||||
root.appendNode('url', PluginBuildPlugin.urlFromOrigin(BuildParams.gitOrigin))
|
||||
Node scmNode = root.appendNode('scm')
|
||||
scmNode.appendNode('url', BuildParams.gitOrigin)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
package org.elasticsearch.gradle.plugin
|
||||
|
||||
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
|
||||
import nebula.plugin.publishing.maven.MavenScmPlugin
|
||||
import org.elasticsearch.gradle.BuildPlugin
|
||||
import org.elasticsearch.gradle.NoticeTask
|
||||
import org.elasticsearch.gradle.Version
|
||||
|
@ -144,13 +143,12 @@ class PluginBuildPlugin implements Plugin<Project> {
|
|||
private void configurePublishing(Project project, PluginPropertiesExtension extension) {
|
||||
// Only configure publishing if applied externally
|
||||
if (extension.hasClientJar) {
|
||||
project.plugins.apply(MavenScmPlugin.class)
|
||||
project.pluginManager.apply('nebula.maven-base-publish')
|
||||
// Only change Jar tasks, we don't want a -client zip so we can't change archivesBaseName
|
||||
project.tasks.withType(Jar) {
|
||||
baseName = baseName + "-client"
|
||||
}
|
||||
// always configure publishing for client jars
|
||||
project.plugins.apply(MavenScmPlugin.class)
|
||||
project.publishing.publications.nebula(MavenPublication).artifactId(extension.name + "-client")
|
||||
project.tasks.withType(GenerateMavenPom.class).configureEach { GenerateMavenPom generatePOMTask ->
|
||||
generatePOMTask.destination = "${project.buildDir}/distributions/${project.archivesBaseName}-client-${project.versions.elasticsearch}.pom"
|
||||
|
|
|
@ -23,7 +23,6 @@ apply plugin: 'elasticsearch.testclusters'
|
|||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'elasticsearch.rest-test'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
apply plugin: 'elasticsearch.rest-resources'
|
||||
|
||||
group = 'org.elasticsearch.client'
|
||||
|
|
|
@ -20,7 +20,6 @@ import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
|
|||
*/
|
||||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
group = 'org.elasticsearch.client'
|
||||
|
||||
|
|
|
@ -357,7 +357,6 @@ configure(subprojects.findAll { it.name == 'integ-test-zip' }) {
|
|||
// The integ-test-distribution is published to maven
|
||||
BuildPlugin.configurePomGeneration(project)
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
// make the pom file name use elasticsearch instead of the project name
|
||||
archivesBaseName = "elasticsearch${it.name.contains('oss') ? '-oss' : ''}"
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'nebula.optional-base'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
dependencies {
|
||||
compile 'net.sf.jopt-simple:jopt-simple:5.0.2'
|
||||
|
|
|
@ -21,7 +21,6 @@ import org.elasticsearch.gradle.info.BuildParams
|
|||
|
||||
apply plugin: 'nebula.optional-base'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
archivesBaseName = 'elasticsearch-core'
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
dependencies {
|
||||
testCompile(project(":test:framework")) {
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
* under the License.
|
||||
*/
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
dependencies {
|
||||
compile project(':libs:elasticsearch-core')
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
* under the License.
|
||||
*/
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
dependencies {
|
||||
// do not add non-test compile dependencies to secure-sm without a good reason to do so
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
apply plugin: "nebula.maven-scm"
|
||||
apply plugin: "nebula.maven-base-publish"
|
||||
|
||||
dependencies {
|
||||
compile project(':libs:elasticsearch-core')
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
dependencies {
|
||||
compile project(':libs:elasticsearch-core')
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
group = 'org.elasticsearch.plugin'
|
||||
archivesBaseName = 'elasticsearch-scripting-painless-spi'
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.elasticsearch.gradle.info.BuildParams
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
apply plugin: "nebula.maven-scm"
|
||||
apply plugin: "nebula.maven-base-publish"
|
||||
|
||||
esplugin {
|
||||
description 'The nio transport.'
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
apply plugin: 'elasticsearch.rest-resources'
|
||||
|
||||
test.enabled = false
|
||||
|
|
|
@ -22,7 +22,6 @@ import org.elasticsearch.gradle.info.BuildParams
|
|||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'nebula.optional-base'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
|
|
|
@ -24,7 +24,6 @@ subprojects {
|
|||
group = 'org.elasticsearch.test'
|
||||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
// TODO: should we have licenses for our test deps?
|
||||
dependencyLicenses.enabled = false
|
||||
|
|
|
@ -6,7 +6,6 @@ import java.nio.file.Paths
|
|||
|
||||
apply plugin: 'elasticsearch.esplugin'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
archivesBaseName = 'x-pack-core'
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import org.elasticsearch.gradle.info.BuildParams
|
|||
evaluationDependsOn(xpackModule('core'))
|
||||
|
||||
apply plugin: 'elasticsearch.esplugin'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
esplugin {
|
||||
name 'x-pack-identity-provider'
|
||||
description 'Elasticsearch Expanded Pack Plugin - Identity Provider'
|
||||
|
|
|
@ -3,7 +3,7 @@ import org.elasticsearch.gradle.info.BuildParams
|
|||
evaluationDependsOn(xpackModule('core'))
|
||||
|
||||
apply plugin: 'elasticsearch.esplugin'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
esplugin {
|
||||
name 'x-pack-security'
|
||||
description 'Elasticsearch Expanded Pack Plugin - Security'
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
|
||||
description = 'JDBC driver for Elasticsearch'
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'nebula.maven-base-publish'
|
||||
apply plugin: 'nebula.maven-scm'
|
||||
|
||||
group = 'org.elasticsearch.client'
|
||||
archivesBaseName = 'x-pack-transport'
|
||||
|
|
Loading…
Reference in New Issue