aboutsummaryrefslogtreecommitdiffstats
path: root/build.gradle
diff options
context:
space:
mode:
authorJacek Poreda <jacek.poreda@sonarsource.com>2024-01-22 17:00:10 +0100
committersonartech <sonartech@sonarsource.com>2024-01-30 15:02:01 +0000
commitc35515b3d5b8017930af3ebcc970b643c175d31d (patch)
tree3df2546fb5626d2c2039e50a7d86fc7175067689 /build.gradle
parent4e7453d5ce1a0d54a45dd28a1c3631df0d1ebcb4 (diff)
downloadsonarqube-c35515b3d5b8017930af3ebcc970b643c175d31d.tar.gz
sonarqube-c35515b3d5b8017930af3ebcc970b643c175d31d.zip
SONAR-21476 Fix JFrog authentication with vault
(cherry picked from commit 4e1f32cb541d3cb5efdbaa5443f088b2d6baaf48)
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle26
1 files changed, 20 insertions, 6 deletions
diff --git a/build.gradle b/build.gradle
index 10c51e2f8ef..7ecd7e2ba1d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -68,18 +68,32 @@ 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') : '')
- 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'
}
url "https://repox.jfrog.io/repox/${repository}"
}
+ ivy {
+ if (artifactoryUsername && artifactoryPassword) {
+ url "${artifactoryUrl}/sonarsource-bucket"
+
+ patternLayout {
+ artifact '/[organisation]/[module]/[module]-[revision].[ext]'
+ }
+ } else {
+ // For public build
+ url "https://artifacts.elastic.co/downloads/"
+
+ patternLayout {
+ artifact '/[organisation]/[module]-[revision].[ext]'
+ }
+ }
+
+ metadataSources { artifact() }
+ }
}
task allDependencies {