aboutsummaryrefslogtreecommitdiffstats
path: root/build.gradle
diff options
context:
space:
mode:
authorJacek Poreda <jacek.poreda@sonarsource.com>2024-01-29 17:20:11 +0100
committersonartech <sonartech@sonarsource.com>2024-01-30 15:02:02 +0000
commit3c923a113b98aa9c4ebacf5ceacf9b23160b1c99 (patch)
tree0799851c425b5992fecba6fba7821cc82f6db0b4 /build.gradle
parentb30ba54383fa653ee40c4b97b9d5c96106361b6a (diff)
downloadsonarqube-3c923a113b98aa9c4ebacf5ceacf9b23160b1c99.tar.gz
sonarqube-3c923a113b98aa9c4ebacf5ceacf9b23160b1c99.zip
SONAR-21476 Fix public repository
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle33
1 files changed, 20 insertions, 13 deletions
diff --git a/build.gradle b/build.gradle
index 431cb948799..23d4fd0fa2f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -73,21 +73,28 @@ allprojects {
throw new GradleException('Invalid artifactoryUrl')
}
- maven {
- if (artifactoryPassword) {
- authentication {
- header(HttpHeaderAuthentication)
- }
- credentials(HttpHeaderCredentials) {
- name = "Authorization"
- value = "Bearer $artifactoryPassword"
- }
- } else {
- // Workaround for artifactory
- // https://www.jfrog.com/jira/browse/RTFACT-13797
- repository = 'public'
+ 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'
+ }
+ maven {
+ url 'https://maven.codelibs.org/'
+ }
}
ivy {
if (artifactoryUsername && artifactoryPassword) {