]> source.dussan.org Git - sonarqube.git/commitdiff
BUILD Fix unauthorized builds with artifactory repo
authorMalena Ebert <malena.ebert@sonarsource.com>
Tue, 17 Nov 2020 08:29:18 +0000 (09:29 +0100)
committersonartech <sonartech@sonarsource.com>
Tue, 17 Nov 2020 20:06:17 +0000 (20:06 +0000)
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

index 17b29a83a03c24340b0897116494fb221c0f6190..86b79176de882b9cf727fc93add91e0e99a3d5e6 100644 (file)
@@ -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}"
     }
   }