File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -95,11 +95,19 @@ allprojects {
95
95
mavenLocal()
96
96
val repository = if (project.hasProperty(" qa" )) " sonarsource-qa" else " sonarsource"
97
97
maven {
98
- credentials {
99
- username = System .getenv(" ARTIFACTORY_PRIVATE_USERNAME" )
100
- password = System .getenv(" ARTIFACTORY_PRIVATE_PASSWORD" )
101
- }
102
98
url = uri(" https://repox.jfrog.io/repox/${repository} " )
99
+
100
+ // The environment variables ARTIFACTORY_PRIVATE_USERNAME and ARTIFACTORY_PRIVATE_PASSWORD are used in QA
101
+ // On local box, please add artifactoryUsername and artifactoryPassword to ~/.gradle/gradle.properties
102
+ val artifactoryUsername = System .getenv(" ARTIFACTORY_PRIVATE_USERNAME" ) ? : project.findProperty(" artifactoryUsername" ) ? : " "
103
+ val artifactoryPassword = System .getenv(" ARTIFACTORY_PRIVATE_PASSWORD" ) ? : project.findProperty(" artifactoryPassword" ) ? : " "
104
+
105
+ if (artifactoryUsername is String && artifactoryUsername.isNotEmpty() && artifactoryPassword is String && artifactoryPassword.isNotEmpty()) {
106
+ credentials {
107
+ username = artifactoryUsername
108
+ password = artifactoryPassword
109
+ }
110
+ }
103
111
}
104
112
}
105
113
}
You can’t perform that action at this time.
0 commit comments