|
|
@@ -300,7 +300,7 @@ class BuildPlugin implements Plugin<Project> {
|
|
|
}
|
|
|
|
|
|
project.tasks.withType(GenerateMavenPom).configureEach({ GenerateMavenPom pomTask ->
|
|
|
- pomTask.destination = "${project.buildDir}/distributions/${project.convention.getPlugin(BasePluginConvention).archivesBaseName}-${project.version}.pom"
|
|
|
+ pomTask.destination = { "${project.buildDir}/distributions/${project.convention.getPlugin(BasePluginConvention).archivesBaseName}-${project.version}.pom" }
|
|
|
} as Action<GenerateMavenPom>)
|
|
|
|
|
|
PublishingExtension publishing = project.extensions.getByType(PublishingExtension)
|
|
|
@@ -313,7 +313,7 @@ class BuildPlugin implements Plugin<Project> {
|
|
|
// 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 root = xml.asNode();
|
|
|
+ Node root = xml.asNode()
|
|
|
root.appendNode('name', project.name)
|
|
|
root.appendNode('description', project.description)
|
|
|
Node dependenciesNode = (root.get('dependencies') as NodeList).get(0) as Node
|
|
|
@@ -328,6 +328,11 @@ class BuildPlugin implements Plugin<Project> {
|
|
|
}
|
|
|
}
|
|
|
generatePomTask.configure({ Task t -> t.dependsOn = ['generatePomFileForShadowPublication'] } as Action<Task>)
|
|
|
+
|
|
|
+ // have to defer this until archivesBaseName is set
|
|
|
+ project.afterEvaluate {
|
|
|
+ publication.artifactId = project.convention.getPlugin(BasePluginConvention).archivesBaseName
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -336,6 +341,11 @@ class BuildPlugin implements Plugin<Project> {
|
|
|
PublishingExtension publishing = project.extensions.getByType(PublishingExtension)
|
|
|
MavenPublication nebulaPublication = (MavenPublication) publishing.publications.getByName('nebula')
|
|
|
nebulaPublication.pom.withXml(this.&addScmInfo)
|
|
|
+
|
|
|
+ // have to defer this until archivesBaseName is set
|
|
|
+ project.afterEvaluate {
|
|
|
+ nebulaPublication.artifactId = project.convention.getPlugin(BasePluginConvention).archivesBaseName
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|