2020-01-27 12:05:34 -05:00
|
|
|
/*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership.
|
|
|
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
* (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2021-10-13 05:50:58 -04:00
|
|
|
// Configure projects for publishing Maven artifacts and set up repeatable metadata.
|
2019-12-02 09:34:57 -05:00
|
|
|
|
2021-10-13 05:50:58 -04:00
|
|
|
configure(rootProject.ext.mavenProjects) { Project project ->
|
|
|
|
project.apply plugin: 'maven-publish'
|
|
|
|
project.apply plugin: 'signing'
|
2019-12-02 09:34:57 -05:00
|
|
|
|
2021-10-13 05:50:58 -04:00
|
|
|
plugins.withType(JavaPlugin) {
|
|
|
|
// We have two types of publications: jars and signed jars.
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
jars(MavenPublication)
|
|
|
|
signedJars(MavenPublication)
|
2021-03-30 06:35:33 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-18 14:58:29 -04:00
|
|
|
// signedJars publication is always signed.
|
|
|
|
signing {
|
|
|
|
sign publishing.publications.signedJars
|
|
|
|
}
|
|
|
|
|
2021-10-13 05:50:58 -04:00
|
|
|
// Each publication consists of the java components, source and javadoc artifacts.
|
|
|
|
// Add tasks to assemble source and javadoc JARs.
|
2020-09-29 03:42:56 -04:00
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
|
|
archiveClassifier = 'sources'
|
|
|
|
from sourceSets.main.allJava
|
|
|
|
}
|
2019-12-02 09:34:57 -05:00
|
|
|
|
2020-09-29 03:42:56 -04:00
|
|
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
|
|
archiveClassifier = 'javadoc'
|
|
|
|
from javadoc.destinationDir
|
|
|
|
}
|
2019-12-02 09:34:57 -05:00
|
|
|
|
2021-10-13 05:50:58 -04:00
|
|
|
// This moves pom metadata configuration after all the scripts of all projects
|
2020-09-29 03:42:56 -04:00
|
|
|
// have been evaluated. This is required because we set artifact groups
|
2021-10-13 05:50:58 -04:00
|
|
|
// and archivesBaseName in other scripts and some of the properties below don't
|
|
|
|
// accept lazy property providers (so everything must be in its final form).
|
2020-09-29 03:42:56 -04:00
|
|
|
gradle.projectsEvaluated {
|
2019-12-02 09:34:57 -05:00
|
|
|
publishing {
|
2021-10-13 05:50:58 -04:00
|
|
|
publications.each { publication ->
|
|
|
|
configure(publication) {
|
|
|
|
from components.java
|
|
|
|
groupId = project.group
|
|
|
|
artifactId = project.archivesBaseName
|
|
|
|
|
|
|
|
artifact sourcesJar
|
|
|
|
artifact javadocJar
|
|
|
|
|
|
|
|
// LUCENE-9561:
|
|
|
|
// Remove dependencyManagement section created by a combination of
|
|
|
|
// Palantir and the publishing plugin.
|
|
|
|
//
|
|
|
|
// https://github.com/palantir/gradle-consistent-versions/issues/550
|
|
|
|
pom({
|
|
|
|
withXml {
|
|
|
|
def dm = asNode().dependencyManagement
|
|
|
|
if (dm) dm.replaceNode {}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Configure pom defaults for all publications.
|
|
|
|
publishing {
|
|
|
|
publications.each { publication ->
|
|
|
|
configure(publication) {
|
|
|
|
pom {
|
|
|
|
name = provider { -> "Apache Lucene (module: ${project.name})" }
|
|
|
|
description = provider { -> "Apache Lucene (module: ${project.name})" }
|
|
|
|
url = "https://lucene.apache.org/"
|
2020-10-04 13:18:29 -04:00
|
|
|
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name = 'Apache 2'
|
2021-10-13 05:50:58 -04:00
|
|
|
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
|
2020-10-04 13:18:29 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
inceptionYear = "2000"
|
|
|
|
|
|
|
|
issueManagement {
|
|
|
|
system = "JIRA"
|
|
|
|
url = "https://issues.apache.org/jira/browse/LUCENE"
|
|
|
|
}
|
|
|
|
|
|
|
|
ciManagement {
|
|
|
|
system = "Jenkins"
|
|
|
|
url = "https://builds.apache.org/job/Lucene/"
|
|
|
|
}
|
|
|
|
|
|
|
|
mailingLists {
|
|
|
|
mailingList {
|
|
|
|
name = "Java User List"
|
|
|
|
subscribe = "java-user-subscribe@lucene.apache.org"
|
|
|
|
unsubscribe = "java-user-unsubscribe@lucene.apache.org"
|
|
|
|
archive = "https://mail-archives.apache.org/mod_mbox/lucene-java-user/"
|
|
|
|
}
|
|
|
|
|
|
|
|
mailingList {
|
|
|
|
name = "Java Developer List"
|
|
|
|
subscribe = "dev-subscribe@lucene.apache.org"
|
|
|
|
unsubscribe = "dev-unsubscribe@lucene.apache.org"
|
|
|
|
archive = "https://mail-archives.apache.org/mod_mbox/lucene-dev/"
|
|
|
|
}
|
|
|
|
|
|
|
|
mailingList {
|
|
|
|
name = "Java Commits List"
|
|
|
|
subscribe = "commits-subscribe@lucene.apache.org"
|
|
|
|
unsubscribe = "commits-unsubscribe@lucene.apache.org"
|
|
|
|
archive = "https://mail-archives.apache.org/mod_mbox/lucene-java-commits/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
scm {
|
2021-03-10 15:47:37 -05:00
|
|
|
connection = 'scm:git:https://gitbox.apache.org/repos/asf/lucene.git'
|
|
|
|
developerConnection = 'scm:git:https://gitbox.apache.org/repos/asf/lucene.git'
|
|
|
|
url = 'https://gitbox.apache.org/repos/asf?p=lucene.git'
|
2020-10-04 13:18:29 -04:00
|
|
|
}
|
2019-12-02 09:34:57 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-13 05:50:58 -04:00
|
|
|
}
|
|
|
|
}
|
2019-12-02 09:34:57 -05:00
|
|
|
|
2021-10-13 05:50:58 -04:00
|
|
|
// Hack: prevent any test fixture JARs from being published.
|
|
|
|
afterEvaluate {
|
|
|
|
configurations.matching { configuration ->
|
|
|
|
configuration.name in [
|
|
|
|
"testFixturesApiElements",
|
|
|
|
"testFixturesRuntimeElements"
|
|
|
|
]
|
|
|
|
}.all {
|
|
|
|
project.components.java.withVariantsFromConfiguration(it) { variant ->
|
|
|
|
variant.skip()
|
2019-12-02 09:34:57 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-13 05:50:58 -04:00
|
|
|
|
|
|
|
// Hack: do not generate or publish gradle metadata files.
|
|
|
|
tasks.withType(GenerateModuleMetadata) {
|
|
|
|
enabled = false
|
|
|
|
}
|
2019-12-02 09:34:57 -05:00
|
|
|
}
|
2021-10-13 05:50:58 -04:00
|
|
|
|