From 10cd062ff176e56c75a530d344b89bc4491ff6df Mon Sep 17 00:00:00 2001 From: Malena Ebert Date: Tue, 17 Nov 2020 09:29:18 +0100 Subject: [PATCH] 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 --- build.gradle | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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}" } } -- 2.39.5