]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-21476 Fix JFrog authentication with vault
authorJacek Poreda <jacek.poreda@sonarsource.com>
Mon, 22 Jan 2024 16:00:10 +0000 (17:00 +0100)
committersonartech <sonartech@sonarsource.com>
Wed, 24 Jan 2024 20:03:32 +0000 (20:03 +0000)
build.gradle
server/sonar-db-dao/src/test/java/org/sonar/db/createdb/CreateDb.java

index 958e27e8db08c3f58a18180bfeefd75ffbb8f3a5..1aace96931fb10e2622d027e882c2de216f6d5aa 100644 (file)
@@ -88,12 +88,7 @@ allprojects {
     }
 
     maven {
-        if (artifactoryUsername && artifactoryPassword) {
-            credentials {
-                username artifactoryUsername
-                password artifactoryPassword
-            }
-        } else {
+        if (!artifactoryUsername || !artifactoryPassword) {
             // Workaround for artifactory
             // https://www.jfrog.com/jira/browse/RTFACT-13797
             repository = 'public'
@@ -102,10 +97,6 @@ allprojects {
     }
     ivy {
           if (artifactoryUsername && artifactoryPassword) {
-              credentials {
-                  username artifactoryUsername
-                  password artifactoryPassword
-              }
               url "${artifactoryUrl}/sonarsource-bucket"
 
               patternLayout {
index 4de6cd7e5611a1463253752e516fccd133ddd423..acd12e0fce4d11751bc92621a51d532734f725a7 100644 (file)
@@ -44,6 +44,7 @@ public class CreateDb {
   private static void createDb(Consumer<Configuration> execute) {
     Configuration configuration = Configuration.builder()
       .addSystemProperties()
+      .addEnvVariables()
       .setProperty("orchestrator.keepDatabase", "false")
       .build();