From 5e6ead969bb60559d9111a66399eaad5a11656bc Mon Sep 17 00:00:00 2001 From: Jacek Poreda Date: Thu, 25 Jan 2024 17:44:51 +0100 Subject: [PATCH] SONAR-21476 Enable JFrog authentication explicitly --- build.gradle | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/build.gradle b/build.gradle index 5fa90e708d5..db4bea40eb9 100644 --- a/build.gradle +++ b/build.gradle @@ -73,28 +73,21 @@ allprojects { throw new GradleException('Invalid artifactoryUrl') } - if (artifactoryPassword) { - if (artifactoryUrl == '') { - throw new GradleException('Invalid artifactoryUrl') - } - maven { - authentication { - header(HttpHeaderAuthentication) - } - credentials(HttpHeaderCredentials) { - name = "Authorization" - value = "Bearer $artifactoryPassword" + maven { + if (artifactoryPassword) { + authentication { + header(HttpHeaderAuthentication) + } + credentials(HttpHeaderCredentials) { + name = "Authorization" + value = "Bearer $artifactoryPassword" + } + } else { + // Workaround for artifactory + // https://www.jfrog.com/jira/browse/RTFACT-13797 + repository = 'public' } url "${artifactoryUrl}/${repository}" - } - } else { - mavenCentral() - maven { - url 'https://jitpack.io' - } - maven { - url 'https://maven.codelibs.org/' - } } ivy { if (artifactoryUsername && artifactoryPassword) { @@ -548,10 +541,10 @@ subprojects { pom { name = 'SonarQube' description = project.description - url = 'http://www.sonarqube.org/' + url = 'https://www.sonarsource.com/products/sonarqube' organization { name = 'SonarSource' - url = 'http://www.sonarsource.com' + url = 'https://www.sonarsource.com' } licenses { license { -- 2.39.5