Merge pull request #18343 from rjernst/pom_desc

Build: More pom generation improvements
This commit is contained in:
Ryan Ernst 2016-05-13 17:00:10 -07:00
commit 2680738a66
4 changed files with 12 additions and 6 deletions

View File

@ -27,6 +27,7 @@ import org.apache.tools.ant.taskdefs.condition.Os
subprojects {
group = 'org.elasticsearch'
version = org.elasticsearch.gradle.VersionProperties.elasticsearch
description = "Elasticsearch subproject ${project.path}"
// we only use maven publish to add tasks for pom generation
plugins.withType(MavenPublishPlugin).whenPluginAdded {

View File

@ -19,6 +19,7 @@
package org.elasticsearch.gradle
import nebula.plugin.extraconfigurations.ProvidedBasePlugin
import nebula.plugin.publishing.maven.MavenBasePublishPlugin
import org.elasticsearch.gradle.precommit.PrecommitTasks
import org.gradle.api.GradleException
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.maven.MavenPom
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.tasks.bundling.Jar
import org.gradle.api.tasks.compile.JavaCompile
@ -343,8 +343,8 @@ class BuildPlugin implements Plugin<Project> {
}
/**Configuration generation of maven poms. */
private static void configurePomGeneration(Project project) {
project.plugins.withType(MavenPublishPlugin.class).whenPluginAdded {
public static void configurePomGeneration(Project project) {
project.plugins.withType(MavenBasePublishPlugin.class).whenPluginAdded {
project.publishing {
publications {
all { MavenPublication publication -> // we only deal with maven

View File

@ -18,6 +18,7 @@
*/
package org.elasticsearch.gradle.plugin
import nebula.plugin.publishing.maven.MavenBasePublishPlugin
import nebula.plugin.publishing.maven.MavenManifestPlugin
import nebula.plugin.publishing.maven.MavenScmPlugin
import org.elasticsearch.gradle.BuildPlugin
@ -51,7 +52,7 @@ public class PluginBuildPlugin extends BuildPlugin {
} else {
project.integTest.clusterConfig.plugin(name, project.bundlePlugin.outputs.files)
project.tasks.run.clusterConfig.plugin(name, project.bundlePlugin.outputs.files)
configurePomGeneration(project)
addPomGeneration(project)
}
project.namingConventions {
@ -131,9 +132,9 @@ public class PluginBuildPlugin extends BuildPlugin {
/**
* 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(MavenManifestPlugin.class)
project.publishing {
publications {

View File

@ -20,6 +20,7 @@
import org.apache.tools.ant.filters.FixCrLfFilter
import org.apache.tools.ant.taskdefs.condition.Os
import org.elasticsearch.gradle.BuildPlugin
import org.elasticsearch.gradle.EmptyDirTask
import org.elasticsearch.gradle.MavenFilteringHack
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...
project.group = "org.elasticsearch.distribution.${project.name}"
project.archivesBaseName = 'elasticsearch'
apply plugin: 'com.bmuschko.nexus'
// 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') {
@ -162,6 +164,8 @@ subprojects {
/*****************************************************************************
* Publishing setup *
*****************************************************************************/
BuildPlugin.configurePomGeneration(project)
apply plugin: 'nebula.info-scm'
apply plugin: 'nebula.maven-base-publish'
apply plugin: 'nebula.maven-scm'
publishing {