mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
[7.17] Fix custom naming on plugin based DRA maven artifacts (#129622)
This commit is contained in:
parent
68e58c4990
commit
580aff1a00
15 changed files with 39 additions and 23 deletions
|
@ -23,6 +23,7 @@ import org.gradle.api.NamedDomainObjectSet;
|
|||
import org.gradle.api.Plugin;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.XmlProvider;
|
||||
import org.gradle.api.component.SoftwareComponent;
|
||||
import org.gradle.api.file.ProjectLayout;
|
||||
import org.gradle.api.plugins.BasePlugin;
|
||||
import org.gradle.api.plugins.BasePluginExtension;
|
||||
|
@ -82,7 +83,8 @@ public class PublishPlugin implements Plugin<Project> {
|
|||
if (project1.getPlugins().hasPlugin(ShadowPlugin.class)) {
|
||||
configureWithShadowPlugin(project1, publication);
|
||||
} else if (project1.getPlugins().hasPlugin(JavaPlugin.class)) {
|
||||
publication.from(project.getComponents().getByName("java"));
|
||||
SoftwareComponent java = project.getComponents().getByName("java");
|
||||
publication.from(java);
|
||||
}
|
||||
});
|
||||
project.getPlugins().withType(JavaPlugin.class, plugin -> {
|
||||
|
|
|
@ -144,25 +144,28 @@ public class PluginBuildPlugin implements Plugin<Project> {
|
|||
}
|
||||
|
||||
private static void configurePublishing(Project project, PluginPropertiesExtension extension) {
|
||||
if (project.getPlugins().hasPlugin(MavenPublishPlugin.class)) {
|
||||
PublishingExtension publishingExtension = project.getExtensions().getByType(PublishingExtension.class);
|
||||
MavenPublication elastic = publishingExtension.getPublications().maybeCreate("elastic", MavenPublication.class);
|
||||
if (extension.isHasClientJar()) {
|
||||
project.getTasks()
|
||||
.withType(Jar.class)
|
||||
.configureEach(jar -> jar.getArchiveBaseName().set(jar.getArchiveBaseName().get() + "-client"));
|
||||
project.getTasks().withType(GenerateMavenPom.class).configureEach(pomTask -> {
|
||||
final BasePluginExtension basepluginExtension = project.getExtensions().getByType(BasePluginExtension.class);
|
||||
String archivesName = basepluginExtension.getArchivesName().get();
|
||||
pomTask.setDestination(
|
||||
new File(project.getBuildDir(), "/distributions/" + archivesName + "-client-" + project.getVersion() + ".pom")
|
||||
);
|
||||
});
|
||||
elastic.setArtifactId(extension.getName() + "-client");
|
||||
} else {
|
||||
elastic.setArtifactId(extension.getName());
|
||||
}
|
||||
}
|
||||
project.getPlugins().withType(MavenPublishPlugin.class).configureEach(plugin -> {
|
||||
project.afterEvaluate(project1 -> {
|
||||
PublishingExtension publishingExtension = project.getExtensions().getByType(PublishingExtension.class);
|
||||
MavenPublication elastic = publishingExtension.getPublications().maybeCreate("elastic", MavenPublication.class);
|
||||
if (extension.isHasClientJar()) {
|
||||
project.getTasks()
|
||||
.withType(Jar.class)
|
||||
.configureEach(jar -> jar.getArchiveBaseName().set(jar.getArchiveBaseName().get() + "-client"));
|
||||
project.getTasks().withType(GenerateMavenPom.class).configureEach(pomTask -> {
|
||||
final BasePluginExtension basepluginExtension = project.getExtensions().getByType(BasePluginExtension.class);
|
||||
String archivesName = basepluginExtension.getArchivesName().get();
|
||||
pomTask.setDestination(
|
||||
new File(project.getBuildDir(), "/distributions/" + archivesName + "-client-" + project.getVersion() + ".pom")
|
||||
);
|
||||
});
|
||||
publishingExtension.getPublications().withType(MavenPublication.class).configureEach(publication -> {
|
||||
publication.setArtifactId(extension.getName() + "-client");
|
||||
});
|
||||
publishingExtension.repositories(repositories -> {});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private static void configureDependencies(final Project project) {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
|
||||
apply plugin: 'elasticsearch.publish'
|
||||
|
||||
esplugin {
|
||||
description 'Adds aggregations whose input are a list of numeric fields and output includes a matrix.'
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
|
||||
apply plugin: 'elasticsearch.legacy-java-rest-test'
|
||||
apply plugin: 'elasticsearch.internal-cluster-test'
|
||||
apply plugin: 'elasticsearch.publish'
|
||||
|
||||
esplugin {
|
||||
description 'Mustache scripting integration for Elasticsearch'
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
|
||||
apply plugin: 'elasticsearch.internal-cluster-test'
|
||||
apply plugin: 'elasticsearch.publish'
|
||||
|
||||
esplugin {
|
||||
description 'Adds advanced field mappers'
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
*/
|
||||
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
|
||||
apply plugin: 'elasticsearch.internal-cluster-test'
|
||||
apply plugin: 'elasticsearch.publish'
|
||||
|
||||
|
||||
esplugin {
|
||||
description 'This module adds the support parent-child queries and aggregations'
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
|
||||
apply plugin: 'elasticsearch.internal-cluster-test'
|
||||
apply plugin: 'elasticsearch.publish'
|
||||
|
||||
esplugin {
|
||||
description 'Percolator module adds capability to index queries and query these queries by specifying documents'
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
|
||||
apply plugin: 'elasticsearch.internal-cluster-test'
|
||||
apply plugin: 'elasticsearch.publish'
|
||||
|
||||
esplugin {
|
||||
description 'The Rank Eval module adds APIs to evaluate ranking quality.'
|
||||
|
|
|
@ -19,6 +19,7 @@ apply plugin: 'elasticsearch.jdk-download'
|
|||
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
|
||||
apply plugin: 'elasticsearch.legacy-java-rest-test'
|
||||
apply plugin: 'elasticsearch.internal-cluster-test'
|
||||
apply plugin: 'elasticsearch.publish'
|
||||
|
||||
esplugin {
|
||||
description 'The Reindex module adds APIs to reindex from one index to another or update documents in place.'
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.gradle.internal.test.InternalClusterTestPlugin
|
|||
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
|
||||
apply plugin: 'elasticsearch.legacy-java-rest-test'
|
||||
apply plugin: 'elasticsearch.internal-cluster-test'
|
||||
apply plugin: 'elasticsearch.publish'
|
||||
|
||||
/*
|
||||
TODOs:
|
||||
|
|
|
@ -9,6 +9,7 @@ import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
|
|||
*/
|
||||
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
|
||||
apply plugin: 'elasticsearch.internal-cluster-test'
|
||||
apply plugin: 'elasticsearch.publish'
|
||||
|
||||
esplugin {
|
||||
description 'The ICU Analysis plugin integrates the Lucene ICU module into Elasticsearch, adding ICU-related analysis components.'
|
||||
|
|
|
@ -14,7 +14,6 @@ subprojects {
|
|||
configure(subprojects.findAll { it.parent.path == project.path }) {
|
||||
group = 'org.elasticsearch.plugin'
|
||||
apply plugin: 'elasticsearch.internal-es-plugin'
|
||||
apply plugin: 'elasticsearch.publish'
|
||||
|
||||
esplugin {
|
||||
// for local ES plugins, the name of the plugin is the same as the directory
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams
|
|||
*/
|
||||
apply plugin: "elasticsearch.publish"
|
||||
apply plugin: 'elasticsearch.internal-cluster-test'
|
||||
apply plugin: 'elasticsearch.publish'
|
||||
|
||||
esplugin {
|
||||
description 'The nio transport.'
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import org.elasticsearch.gradle.internal.info.BuildParams
|
||||
apply plugin: 'elasticsearch.internal-es-plugin'
|
||||
apply plugin: 'elasticsearch.publish'
|
||||
apply plugin: 'elasticsearch.internal-cluster-test'
|
||||
esplugin {
|
||||
name 'x-pack-identity-provider'
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'elasticsearch.publish'
|
||||
|
||||
group = 'org.elasticsearch.client'
|
||||
|
||||
base {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue