From 8ee3de122b56f96d3d0c44345ae60302bc1f45b8 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 7 Feb 2018 19:21:43 -0800 Subject: [PATCH] Build: Remove x-pack-api jar (elastic/x-pack-elasticsearch#3864) The api jar was added for xpack extensions. However, extensions have been removed in favor of using SPI, and the individual xpack jars like core and security are published to enable this. This commit removes the api jar, and switches the transport client to use the core jar (which the api jar was just a rename of). Original commit: elastic/x-pack-elasticsearch@58e069e66ca4712aa842f59195e78815319c0d37 --- build.gradle | 1 - plugin/build.gradle | 2 +- plugin/core/build.gradle | 32 -------------------------------- transport-client/build.gradle | 2 +- 4 files changed, 2 insertions(+), 35 deletions(-) diff --git a/build.gradle b/build.gradle index e3a6d6cc4b2..274ed36f27a 100644 --- a/build.gradle +++ b/build.gradle @@ -65,7 +65,6 @@ subprojects { approvedLicenses = ['Elasticsearch Confidential', 'Generated'] additionalLicense 'ESCON', 'Elasticsearch Confidential', 'ELASTICSEARCH CONFIDENTIAL' } - ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-api:${version}": xpackModule('core')] ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-core:${version}": xpackModule('core')] ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-deprecation:${version}": xpackModule('deprecation')] ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-graph:${version}": xpackModule('graph')] diff --git a/plugin/build.gradle b/plugin/build.gradle index 06e96e3d4ee..b7e907f1050 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -10,7 +10,7 @@ import org.elasticsearch.gradle.test.RunTask; apply plugin: 'elasticsearch.es-meta-plugin' -archivesBaseName = 'x-pack' // for api jar +archivesBaseName = 'x-pack' es_meta_plugin { name = 'x-pack' diff --git a/plugin/core/build.gradle b/plugin/core/build.gradle index 980ccb801d1..e1090e4d799 100644 --- a/plugin/core/build.gradle +++ b/plugin/core/build.gradle @@ -85,38 +85,6 @@ sourceSets.test.java { srcDir '../../license-tools/src/main/java' } -// TODO: remove this jar once xpack extensions have been removed -// assemble the API JAR for the transport-client and extension authors; this JAR is the core JAR by another name -project.afterEvaluate { - task apiJar { - dependsOn('generatePomFileForApijarPublication', project.jar) - doFirst { - Path jarFile = project.jar.outputs.files.singleFile.toPath() - String apiFileName = jarFile.fileName.toString().replace("core-${project.version}", "api-${project.version}") - Files.copy(jarFile, jarFile.resolveSibling(apiFileName), StandardCopyOption.REPLACE_EXISTING) - - String pomFileName = jarFile.fileName.toString().replace('.jar', '.pom') - String apiPomFileName = apiFileName.replace('.jar', '.pom') - Files.copy(jarFile.resolveSibling(pomFileName), jarFile.resolveSibling(apiPomFileName), - StandardCopyOption.REPLACE_EXISTING) - } - } - assemble.dependsOn(apiJar) - project.publishing { - publications { - apijar(MavenPublication) { - from project.components.java - artifactId = 'x-pack-api' - pom.withXml { XmlProvider xml -> - Node root = xml.asNode() - root.appendNode('name', project.pluginProperties.extension.name) - root.appendNode('description', project.pluginProperties.extension.description) - } - } - } - } -} - test { /* * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each diff --git a/transport-client/build.gradle b/transport-client/build.gradle index 92a786b6f31..31c05569274 100644 --- a/transport-client/build.gradle +++ b/transport-client/build.gradle @@ -10,7 +10,7 @@ archivesBaseName = 'x-pack-transport' dependencies { // this "api" dependency looks weird, but it is correct, as it contains // all of x-pack for now, and transport client will be going away in the future. - compile "org.elasticsearch.plugin:x-pack-api:${version}" + compile "org.elasticsearch.plugin:x-pack-core:${version}" compile "org.elasticsearch.client:transport:${version}" testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" testCompile "junit:junit:${versions.junit}"