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 {