Skip to content

Commit 793a4f2

Browse files
Fix repositories URLs (#63)
* Fix repository URLs * Remove repositories already mirrored by repox.jfrog
1 parent 34903b5 commit 793a4f2

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

build.gradle

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,28 @@ if (version.endsWith('-SNAPSHOT') && ext.buildNumber != null) {
4545
version = version.replace('-SNAPSHOT', versionSuffix)
4646
}
4747

48+
ext {
49+
release = project.hasProperty('release') && project.getProperty('release')
50+
official = project.hasProperty('official') && project.getProperty('official')
51+
}
52+
4853
repositories {
49-
jcenter()
50-
mavenLocal()
51-
mavenCentral()
5254
maven {
5355
url "https://maven.google.com"
5456
}
57+
def repository = project.hasProperty('qa') ? 'sonarsource-qa' : 'sonarsource'
5558
maven {
56-
url "https://repox.sonarsource.com/sonarsource"
59+
url "https://repox.jfrog.io/repox/${repository}"
60+
// The environment variables ARTIFACTORY_PRIVATE_USERNAME and ARTIFACTORY_PRIVATE_PASSWORD are used on QA env (Jenkins)
61+
// On local box, please add artifactoryUsername and artifactoryPassword to ~/.gradle/gradle.properties
62+
def artifactoryUsername = System.env.'ARTIFACTORY_PRIVATE_USERNAME' ?: (project.hasProperty('artifactoryUsername') ? project.getProperty('artifactoryUsername') : '')
63+
def artifactoryPassword = System.env.'ARTIFACTORY_PRIVATE_PASSWORD' ?: (project.hasProperty('artifactoryPassword') ? project.getProperty('artifactoryPassword') : '')
64+
if (artifactoryUsername && artifactoryPassword) {
65+
credentials {
66+
username artifactoryUsername
67+
password artifactoryPassword
68+
}
69+
}
5770
}
5871
}
5972

0 commit comments

Comments
 (0)