LUCENE-9547: Race condition in maven artifact configuration results in wrong group/ artifact name

This commit is contained in:
Dawid Weiss 2020-09-29 09:42:56 +02:00
parent 65a62b04c5
commit 2b692ccb71
1 changed files with 26 additions and 15 deletions

View File

@ -69,26 +69,37 @@ configure(rootProject) {
":solr:test-framework",
]
}
}
configure(subprojects.findAll { it.path in rootProject.published }) {
apply plugin: 'maven-publish'
apply plugin: 'signing'
configure(subprojects.findAll { it.path in rootProject.published }) { prj ->
apply plugin: 'maven-publish'
apply plugin: 'signing'
publishing {
// TODO: Add publishing repository details.
publishing {
// TODO: Add publishing repository details.
}
plugins.withType(JavaPlugin) {
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}
plugins.withType(JavaPlugin) {
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
// This moves publishing configuration after all the scripts of all projects
// have been evaluated. This is required because we set artifact groups
// and archivesBaseName in other scripts (artifact-naming.gradle) and
// maven pom does not accept lazy property providers (so everything must
// be in its final form).
//
// In theory project.afterEvaluate closure should also work but for some reason
// it fired earlier than artifact-naming.gradle; don't know whether it's a bug
// in gradle or just complex relationships between lazy collection hooks.
gradle.projectsEvaluated {
publishing {
def configurePom = {
name = "Apache Solr/Lucene (${project.name})"