From 0d5ac896369946c54934378ebf333cd77bcfb311 Mon Sep 17 00:00:00 2001 From: herlarb Date: Sat, 31 Mar 2018 13:46:33 +0100 Subject: [PATCH] Resolved MavenDeployer Authentication and Signing Issues --- build.gradle | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 1f5fe6d..b3c43d2 100644 --- a/build.gradle +++ b/build.gradle @@ -47,8 +47,11 @@ artifacts { } -signing { - sign configurations.archives +if (project.hasProperty("signing.keyId")) { + apply plugin: 'signing' + signing { + sign configurations.archives + } } def isReleaseBuild() { @@ -63,11 +66,11 @@ uploadArchives { beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: ossrhUsername, password: ossrhPassword) + authentication(userName: findProperty('ossrhUsername'), password: findProperty('ossrhPassword')) } snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: ossrhUsername, password: ossrhPassword) + authentication(userName: findProperty('ossrhUsername'), password: findProperty('ossrhPassword')) } pom.project {