From 8f24b6c18f3da5d2de1db3d637bc6eeb9e2542a2 Mon Sep 17 00:00:00 2001 From: Jacek Poreda Date: Mon, 29 Jan 2024 17:05:59 +0100 Subject: SONAR-21476 Fix public repository --- settings.gradle | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'settings.gradle') diff --git a/settings.gradle b/settings.gradle index 8d4101493af..284b3f241d2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,13 +1,19 @@ pluginManagement { repositories { + def artifactoryPassword = System.env.'ARTIFACTORY_PRIVATE_PASSWORD' + maven { - url 'https://repox.jfrog.io/repox/plugins.gradle.org/' - authentication { - header(HttpHeaderAuthentication) - } - credentials(HttpHeaderCredentials) { - name = "Authorization" - value = "Bearer $System.env.ARTIFACTORY_PRIVATE_PASSWORD" + if (artifactoryPassword) { + url 'https://repox.jfrog.io/repox/plugins.gradle.org/' + authentication { + header(HttpHeaderAuthentication) + } + credentials(HttpHeaderCredentials) { + name = "Authorization" + value = "Bearer $artifactoryPassword" + } + } else { + url 'https://plugins.gradle.org/m2/' } } } -- cgit v1.2.3