]> source.dussan.org Git - sonarqube.git/commitdiff
[NO-JIRA] Read artifactory url from gradle local configuration
authorPhilippe Perrin <philippe.perrin@sonarsource.com>
Mon, 16 Oct 2023 12:12:52 +0000 (14:12 +0200)
committersonartech <sonartech@sonarsource.com>
Mon, 16 Oct 2023 20:02:49 +0000 (20:02 +0000)
build.gradle

index 2351491aebfa169359e3cebf058dbfe901f7848f..00ce8916b86e92f042af614c62e245cda0b826ba 100644 (file)
@@ -82,7 +82,11 @@ allprojects {
     // 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') : '')
     def artifactoryPassword = System.env.'ARTIFACTORY_PRIVATE_PASSWORD' ?: (project.hasProperty('artifactoryPassword') ? project.getProperty('artifactoryPassword') : '')
-    def artifactoryUrl = System.getenv('ARTIFACTORY_URL')
+    def artifactoryUrl = System.getenv('ARTIFACTORY_URL') ?: (project.hasProperty('artifactoryUrl') ? project.getProperty('artifactoryUrl') : '')
+
+    if (artifactoryUrl == '') {
+      throw new GradleException('Invalid artifactoryUrl')
+    }
 
     maven {
         if (artifactoryUsername && artifactoryPassword) {