From e6ac51688c6e922425cac8e59b7fd68a5bf381b6 Mon Sep 17 00:00:00 2001 From: Graham Date: Thu, 13 Feb 2020 19:44:35 +0000 Subject: [PATCH] Skip openrs2 repositories if no username/password are supplied --- build.gradle.kts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 6dc52ab4..e60a5e00 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -21,16 +21,18 @@ allprojects { repositories { mavenLocal() mavenCentral() - maven(url = "https://repo.openrs2.dev/repository/openrs2") { - credentials { - username = findProperty("repoUsername")?.toString() - password = findProperty("repoPassword")?.toString() + if (hasProperty("repoUsername")) { + maven(url = "https://repo.openrs2.dev/repository/openrs2") { + credentials { + username = findProperty("repoUsername")?.toString() + password = findProperty("repoPassword")?.toString() + } } - } - maven(url = "https://repo.openrs2.dev/repository/openrs2-snapshots") { - credentials { - username = findProperty("repoUsername")?.toString() - password = findProperty("repoPassword")?.toString() + maven(url = "https://repo.openrs2.dev/repository/openrs2-snapshots") { + credentials { + username = findProperty("repoUsername")?.toString() + password = findProperty("repoPassword")?.toString() + } } } maven(url = "https://dl.bintray.com/michaelbull/maven")