From 4275a870d54a58b3bfbcf39416355431afc1f4fb Mon Sep 17 00:00:00 2001 From: Lanchon Date: Thu, 21 Sep 2017 23:24:54 -0300 Subject: [PATCH] Allow builds without OSSRH credentials --- build.gradle | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index d98a28a..af196fe 100644 --- a/build.gradle +++ b/build.gradle @@ -100,12 +100,14 @@ uploadArchives { } } - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication userName: ossrhUsername, password: ossrhPassword - } + if (project.hasProperty('ossrhUsername')) { + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication userName: ossrhUsername, password: ossrhPassword + } - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication userName: ossrhUsername, password: ossrhPassword + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { + authentication userName: ossrhUsername, password: ossrhPassword + } } beforeDeployment {