]> source.dussan.org Git - sonarqube.git/commitdiff
Use maven public repo
authorJacek Poreda <jacek.poreda@sonarsource.com>
Mon, 29 Jan 2024 15:26:34 +0000 (16:26 +0100)
committerJacek Poreda <jacek.poreda@sonarsource.com>
Mon, 29 Jan 2024 15:26:34 +0000 (16:26 +0100)
build.gradle

index d2c3abe5e6f7cfbce1c2d9f3740bbf1624be925c..266681c542390112c6404ebba3a49c0edc7f8ee9 100644 (file)
@@ -83,27 +83,26 @@ allprojects {
     def artifactoryPassword = System.env.'ARTIFACTORY_PRIVATE_PASSWORD' ?: (project.hasProperty('artifactoryPassword') ? project.getProperty('artifactoryPassword') : '')
     def artifactoryUrl = System.getenv('ARTIFACTORY_URL') ?: (project.hasProperty('artifactoryUrl') ? project.getProperty('artifactoryUrl') : '')
 
-    if (artifactoryUrl == '') {
-      throw new GradleException('Invalid artifactoryUrl')
-    }
-
-    maven {
-        if (artifactoryPassword) {
-          authentication {
-            header(HttpHeaderAuthentication)
-          }
-          credentials(HttpHeaderCredentials) {
-            name = "Authorization"
-            value = "Bearer $artifactoryPassword"
-          }
-          url "${artifactoryUrl}/${repository}"
-        } else {
+    if (artifactoryPassword) {
+      if (artifactoryUrl == '') {
+        throw new GradleException('Invalid artifactoryUrl')
+      }
+      maven {
+        authentication {
+          header(HttpHeaderAuthentication)
+        }
+        credentials(HttpHeaderCredentials) {
+          name = "Authorization"
+          value = "Bearer $artifactoryPassword"
+        }
+        url "${artifactoryUrl}/${repository}"
+      }
+    } else {
+        mavenCentral()
+        maven {
           url 'https://jitpack.io'
         }
     }
-    if (!artifactoryPassword) {
-      mavenCentral()
-    }
     ivy {
           if (artifactoryUsername && artifactoryPassword) {
               url "${artifactoryUrl}/sonarsource-bucket"