Build: More pom generation improvements
This adds a non empty description to all generated poms, as well as fixing distributions so they actually have a generated pom.
This commit is contained in:
parent
8f82fa9a58
commit
5aea24137c
|
@ -27,6 +27,7 @@ import org.apache.tools.ant.taskdefs.condition.Os
|
||||||
subprojects {
|
subprojects {
|
||||||
group = 'org.elasticsearch'
|
group = 'org.elasticsearch'
|
||||||
version = org.elasticsearch.gradle.VersionProperties.elasticsearch
|
version = org.elasticsearch.gradle.VersionProperties.elasticsearch
|
||||||
|
description = "Elasticsearch subproject ${project.path}"
|
||||||
|
|
||||||
// we only use maven publish to add tasks for pom generation
|
// we only use maven publish to add tasks for pom generation
|
||||||
plugins.withType(MavenPublishPlugin).whenPluginAdded {
|
plugins.withType(MavenPublishPlugin).whenPluginAdded {
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
package org.elasticsearch.gradle
|
package org.elasticsearch.gradle
|
||||||
|
|
||||||
import nebula.plugin.extraconfigurations.ProvidedBasePlugin
|
import nebula.plugin.extraconfigurations.ProvidedBasePlugin
|
||||||
|
import nebula.plugin.publishing.maven.MavenBasePublishPlugin
|
||||||
import org.elasticsearch.gradle.precommit.PrecommitTasks
|
import org.elasticsearch.gradle.precommit.PrecommitTasks
|
||||||
import org.gradle.api.GradleException
|
import org.gradle.api.GradleException
|
||||||
import org.gradle.api.JavaVersion
|
import org.gradle.api.JavaVersion
|
||||||
|
@ -34,7 +35,6 @@ import org.gradle.api.artifacts.ResolvedArtifact
|
||||||
import org.gradle.api.artifacts.dsl.RepositoryHandler
|
import org.gradle.api.artifacts.dsl.RepositoryHandler
|
||||||
import org.gradle.api.artifacts.maven.MavenPom
|
import org.gradle.api.artifacts.maven.MavenPom
|
||||||
import org.gradle.api.publish.maven.MavenPublication
|
import org.gradle.api.publish.maven.MavenPublication
|
||||||
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin
|
|
||||||
import org.gradle.api.publish.maven.tasks.GenerateMavenPom
|
import org.gradle.api.publish.maven.tasks.GenerateMavenPom
|
||||||
import org.gradle.api.tasks.bundling.Jar
|
import org.gradle.api.tasks.bundling.Jar
|
||||||
import org.gradle.api.tasks.compile.JavaCompile
|
import org.gradle.api.tasks.compile.JavaCompile
|
||||||
|
@ -343,8 +343,8 @@ class BuildPlugin implements Plugin<Project> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**Configuration generation of maven poms. */
|
/**Configuration generation of maven poms. */
|
||||||
private static void configurePomGeneration(Project project) {
|
public static void configurePomGeneration(Project project) {
|
||||||
project.plugins.withType(MavenPublishPlugin.class).whenPluginAdded {
|
project.plugins.withType(MavenBasePublishPlugin.class).whenPluginAdded {
|
||||||
project.publishing {
|
project.publishing {
|
||||||
publications {
|
publications {
|
||||||
all { MavenPublication publication -> // we only deal with maven
|
all { MavenPublication publication -> // we only deal with maven
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.gradle.plugin
|
package org.elasticsearch.gradle.plugin
|
||||||
|
|
||||||
|
import nebula.plugin.publishing.maven.MavenBasePublishPlugin
|
||||||
import nebula.plugin.publishing.maven.MavenManifestPlugin
|
import nebula.plugin.publishing.maven.MavenManifestPlugin
|
||||||
import nebula.plugin.publishing.maven.MavenScmPlugin
|
import nebula.plugin.publishing.maven.MavenScmPlugin
|
||||||
import org.elasticsearch.gradle.BuildPlugin
|
import org.elasticsearch.gradle.BuildPlugin
|
||||||
|
@ -51,7 +52,7 @@ public class PluginBuildPlugin extends BuildPlugin {
|
||||||
} else {
|
} else {
|
||||||
project.integTest.clusterConfig.plugin(name, project.bundlePlugin.outputs.files)
|
project.integTest.clusterConfig.plugin(name, project.bundlePlugin.outputs.files)
|
||||||
project.tasks.run.clusterConfig.plugin(name, project.bundlePlugin.outputs.files)
|
project.tasks.run.clusterConfig.plugin(name, project.bundlePlugin.outputs.files)
|
||||||
configurePomGeneration(project)
|
addPomGeneration(project)
|
||||||
}
|
}
|
||||||
|
|
||||||
project.namingConventions {
|
project.namingConventions {
|
||||||
|
@ -131,9 +132,9 @@ public class PluginBuildPlugin extends BuildPlugin {
|
||||||
/**
|
/**
|
||||||
* Adds the plugin jar and zip as publications.
|
* Adds the plugin jar and zip as publications.
|
||||||
*/
|
*/
|
||||||
private static void configurePomGeneration(Project project) {
|
protected static void addPomGeneration(Project project) {
|
||||||
|
project.plugins.apply(MavenBasePublishPlugin.class)
|
||||||
project.plugins.apply(MavenScmPlugin.class)
|
project.plugins.apply(MavenScmPlugin.class)
|
||||||
project.plugins.apply(MavenManifestPlugin.class)
|
|
||||||
|
|
||||||
project.publishing {
|
project.publishing {
|
||||||
publications {
|
publications {
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
import org.apache.tools.ant.filters.FixCrLfFilter
|
import org.apache.tools.ant.filters.FixCrLfFilter
|
||||||
import org.apache.tools.ant.taskdefs.condition.Os
|
import org.apache.tools.ant.taskdefs.condition.Os
|
||||||
|
import org.elasticsearch.gradle.BuildPlugin
|
||||||
import org.elasticsearch.gradle.EmptyDirTask
|
import org.elasticsearch.gradle.EmptyDirTask
|
||||||
import org.elasticsearch.gradle.MavenFilteringHack
|
import org.elasticsearch.gradle.MavenFilteringHack
|
||||||
import org.elasticsearch.gradle.precommit.DependencyLicensesTask
|
import org.elasticsearch.gradle.precommit.DependencyLicensesTask
|
||||||
|
@ -114,6 +115,7 @@ subprojects {
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
// note: the group must be correct before applying the nexus plugin, or it will capture the wrong value...
|
// note: the group must be correct before applying the nexus plugin, or it will capture the wrong value...
|
||||||
project.group = "org.elasticsearch.distribution.${project.name}"
|
project.group = "org.elasticsearch.distribution.${project.name}"
|
||||||
|
project.archivesBaseName = 'elasticsearch'
|
||||||
apply plugin: 'com.bmuschko.nexus'
|
apply plugin: 'com.bmuschko.nexus'
|
||||||
// we must create our own install task, because it is only added when the java plugin is added
|
// we must create our own install task, because it is only added when the java plugin is added
|
||||||
task install(type: Upload, description: "Installs the 'archives' artifacts into the local Maven repository.", group: 'Upload') {
|
task install(type: Upload, description: "Installs the 'archives' artifacts into the local Maven repository.", group: 'Upload') {
|
||||||
|
@ -162,6 +164,8 @@ subprojects {
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Publishing setup *
|
* Publishing setup *
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
BuildPlugin.configurePomGeneration(project)
|
||||||
|
apply plugin: 'nebula.info-scm'
|
||||||
apply plugin: 'nebula.maven-base-publish'
|
apply plugin: 'nebula.maven-base-publish'
|
||||||
apply plugin: 'nebula.maven-scm'
|
apply plugin: 'nebula.maven-scm'
|
||||||
publishing {
|
publishing {
|
||||||
|
|
Loading…
Reference in New Issue