Skip to content

Commit

Permalink
SONAR-21476 Enable JFrog authentication explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
jacek-poreda-sonarsource authored and sonartech committed Feb 6, 2024
1 parent f87b566 commit 5e6ead9
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,21 @@ allprojects {
throw new GradleException('Invalid artifactoryUrl')
}

if (artifactoryPassword) {
if (artifactoryUrl == '') {
throw new GradleException('Invalid artifactoryUrl')
}
maven {
authentication {
header(HttpHeaderAuthentication)
}
credentials(HttpHeaderCredentials) {
name = "Authorization"
value = "Bearer $artifactoryPassword"
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'
}
url "${artifactoryUrl}/${repository}"
}
} else {
mavenCentral()
maven {
url 'https://jitpack.io'
}
maven {
url 'https://maven.codelibs.org/'
}
}
ivy {
if (artifactoryUsername && artifactoryPassword) {
Expand Down Expand Up @@ -548,10 +541,10 @@ subprojects {
pom {
name = 'SonarQube'
description = project.description
url = 'http://www.sonarqube.org/'
url = 'https://www.sonarsource.com/products/sonarqube'
organization {
name = 'SonarSource'
url = 'http://www.sonarsource.com'
url = 'https://www.sonarsource.com'
}
licenses {
license {
Expand Down

0 comments on commit 5e6ead9

Please sign in to comment.