diff --git a/buildSrc/src/main/kotlin/ort-plugins-conventions.gradle.kts b/buildSrc/src/main/kotlin/ort-plugins-conventions.gradle.kts index 0d2004cfbda99..b5b2015bc9cdb 100644 --- a/buildSrc/src/main/kotlin/ort-plugins-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/ort-plugins-conventions.gradle.kts @@ -24,6 +24,7 @@ plugins { // Apply precompiled plugins. id("ort-base-conventions") + id("ort-publication-conventions") } javaPlatform { @@ -41,29 +42,3 @@ dependencies { api(it) } } - -configure { - publications { - create(name) { - groupId = "org.ossreviewtoolkit.plugins" - - from(components["javaPlatform"]) - - pom { - licenses { - license { - name = "Apache-2.0" - url = "https://www.apache.org/licenses/LICENSE-2.0" - } - } - - scm { - connection = "scm:git:https://github.com/oss-review-toolkit/ort.git" - developerConnection = "scm:git:git@github.com:oss-review-toolkit/ort.git" - tag = version.toString() - url = "https://github.com/oss-review-toolkit/ort" - } - } - } - } -} diff --git a/buildSrc/src/main/kotlin/ort-publication-conventions.gradle.kts b/buildSrc/src/main/kotlin/ort-publication-conventions.gradle.kts index 425739dd7a00d..9bcbf03a5558b 100644 --- a/buildSrc/src/main/kotlin/ort-publication-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/ort-publication-conventions.gradle.kts @@ -35,9 +35,8 @@ configure { groupId = "org${getGroupId(parent)}" - from(components["java"]) - artifact(tasks["sourcesJar"]) - artifact(tasks["docsJavadocJar"]) + listOf("java", "javaPlatform").mapNotNull { components.findByName(it) }.forEach(::from) + listOf("sourcesJar", "docsJavadocJar").mapNotNull { tasks.findByName(it) }.forEach(::artifact) pom { name = project.name