diff --git a/api/build.gradle b/api/build.gradle index 046529c443..0869ca194a 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -91,6 +91,16 @@ java { withJavadocJar() } +publishing { + publications.named('mavenJava', MavenPublication) { + from components.java + pom { + name = 'API library' + description = "$project.description" + } + } +} + tasks.named('test') { useJUnitPlatform() finalizedBy jacocoTestReport diff --git a/buildSrc/src/main/groovy/halo.publish.gradle b/buildSrc/src/main/groovy/halo.publish.gradle index ce1932ff7b..41a2f7276b 100644 --- a/buildSrc/src/main/groovy/halo.publish.gradle +++ b/buildSrc/src/main/groovy/halo.publish.gradle @@ -1,43 +1,30 @@ plugins { id 'maven-publish' + id 'signing' } publishing { - publications { - def pubName = "${archivesBaseName}" - pluginManager.withPlugin('java-platform') { - pubName = pubName + 'Pom' - } - pluginManager.withPlugin('java') { - pubName = pubName + 'Library' - } - "${pubName}"(MavenPublication) { - pluginManager.withPlugin('java-platform') { - from components.javaPlatform - } - pluginManager.withPlugin('java') { - from components.java - } - pom { - licenses { - license { - name = 'The GNU General Public License v3.0' - url = 'https://www.gnu.org/licenses/gpl-3.0.en.html' - } - } - developers { - developer { - id = 'johnniang' - name = 'JohnNiang' - email = 'johnniang@foxmil.com' - } + publications.register('mavenJava', MavenPublication) { + pom { + url = 'https://github.com/halo-dev/halo' + licenses { + license { + name = 'The GNU General Public License v3.0' + url = 'https://www.gnu.org/licenses/gpl-3.0.en.html' } - scm { - connection = 'scm:git:https://github.com/halo-dev/halo.git' - developerConnection = 'scm:git:ssh://git@github.com:halo-dev/halo.git' - url = 'https://github.com/halo-dev/halo' + } + developers { + developer { + id = 'johnniang' + name = 'JohnNiang' + email = 'johnniang@foxmail.com' } } + scm { + connection = 'scm:git:https://github.com/halo-dev/halo.git' + developerConnection = 'scm:git:ssh://git@github.com:halo-dev/halo.git' + url = 'https://github.com/halo-dev/halo' + } } } @@ -53,4 +40,8 @@ publishing { } } } -} \ No newline at end of file +} + +signing { + sign publishing.publications.mavenJava +} diff --git a/platform/application/build.gradle b/platform/application/build.gradle index f4e63f645c..e4765de0eb 100644 --- a/platform/application/build.gradle +++ b/platform/application/build.gradle @@ -4,7 +4,6 @@ plugins { id 'org.springframework.boot' apply false id 'java-platform' id 'halo.publish' - id 'signing' } group = 'run.halo.tools.platform' @@ -63,3 +62,13 @@ dependencies { } } + +publishing { + publications.named('mavenJava', MavenPublication) { + from components.javaPlatform + pom { + name = 'Application platform.' + description = "$project.description" + } + } +} diff --git a/platform/plugin/build.gradle b/platform/plugin/build.gradle index 39f1a9152a..1b60dd2bfe 100644 --- a/platform/plugin/build.gradle +++ b/platform/plugin/build.gradle @@ -19,3 +19,13 @@ dependencies { // e.g.: api 'halo.run.plugin:links-api:1.1.0' } } + +publishing { + publications.named('mavenJava', MavenPublication) { + from components.javaPlatform + pom { + name = 'Plugin platform' + description = "$project.description" + } + } +}