From: Malena Ebert Date: Tue, 17 Nov 2020 08:29:18 +0000 (+0100) Subject: BUILD Fix unauthorized builds with artifactory repo X-Git-Tag: 8.6.0.39681~97 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=10cd062ff176e56c75a530d344b89bc4491ff6df;p=sonarqube.git BUILD Fix unauthorized builds with artifactory repo Due to a misbehavior in artifactory, the wrong http status code is returned and the build will stop immediately. This happens if you access a virtual repository which contains a repository which requires authentication. As a workaround a virtual repository is used, which does not include non-public repositories. https://www.jfrog.com/jira/browse/RTFACT-13797 --- diff --git a/build.gradle b/build.gradle index 17b29a83a03..86b79176de8 100644 --- a/build.gradle +++ b/build.gradle @@ -87,7 +87,6 @@ allprojects { repositories { def repository = project.hasProperty('qa') ? 'sonarsource-qa' : 'sonarsource' maven { - url "https://repox.jfrog.io/repox/${repository}" // The environment variables ARTIFACTORY_PRIVATE_USERNAME and ARTIFACTORY_PRIVATE_PASSWORD are used on QA env (Jenkins) // On local box, please add artifactoryUsername and artifactoryPassword to ~/.gradle/gradle.properties def artifactoryUsername = System.env.'ARTIFACTORY_PRIVATE_USERNAME' ?: (project.hasProperty('artifactoryUsername') ? project.getProperty('artifactoryUsername') : '') @@ -97,7 +96,12 @@ allprojects { username artifactoryUsername password artifactoryPassword } + } else { + // Workaround for artifactory + // https://www.jfrog.com/jira/browse/RTFACT-13797 + repository = 'public' } + url "https://repox.jfrog.io/repox/${repository}" } }