From 8341bd103ae366a3be6df14b96ea1076bdda06af Mon Sep 17 00:00:00 2001 From: Jonathan Bullock Date: Thu, 22 Sep 2022 00:30:42 +0100 Subject: [PATCH] Fixed signing for publishing to Maven Central. --- gradle/signing.gradle | 15 +++++++++++++++ jbake-core/build.gradle | 1 + jbake-maven-plugin/build.gradle | 1 + 3 files changed, 17 insertions(+) create mode 100644 gradle/signing.gradle diff --git a/gradle/signing.gradle b/gradle/signing.gradle new file mode 100644 index 00000000..a8b0abec --- /dev/null +++ b/gradle/signing.gradle @@ -0,0 +1,15 @@ +if ( !project.hasProperty('skipSigning') ) { + apply plugin: 'signing' + + if (!signing.signatory) { + logger.warn "No Signatory configured for project $project.name. Skip signing! See https://docs.gradle.org/current/userguide/signing_plugin.html" + ext.skipSigning = true + } + else { + if ( project.name != "jbake-dist" ) { + signing { + sign publishing.publications.mavenJava + } + } + } +} diff --git a/jbake-core/build.gradle b/jbake-core/build.gradle index 820938c4..626a11a6 100644 --- a/jbake-core/build.gradle +++ b/jbake-core/build.gradle @@ -7,6 +7,7 @@ plugins { } apply from: "$rootDir/gradle/maven-publishing.gradle" +apply from: "$rootDir/gradle/signing.gradle" description = "The core library of JBake" diff --git a/jbake-maven-plugin/build.gradle b/jbake-maven-plugin/build.gradle index fabf47e2..6238eef0 100644 --- a/jbake-maven-plugin/build.gradle +++ b/jbake-maven-plugin/build.gradle @@ -10,6 +10,7 @@ mavenPlugin { } apply from: "$rootDir/gradle/maven-publishing.gradle" +apply from: "$rootDir/gradle/signing.gradle" publishing { publications {