Skip to content

Commit 6f58e12

Browse files
committed
Set credentials only if supplied
1 parent efbcdb4 commit 6f58e12

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

settings.gradle.kts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ dependencyResolutionManagement {
33
mavenCentral()
44
maven {
55
url = uri("https://repository.caplin.com/repository/caplin-release")
6-
credentials {
7-
val caplinUsername: String? by settings
8-
val caplinPassword: String? by settings
9-
username = caplinUsername ?: System.getenv("CAPLIN_USERNAME")
10-
password = caplinPassword ?: System.getenv("CAPLIN_PASSWORD")
6+
val caplinUsername: String? by settings
7+
val caplinPassword: String? by settings
8+
val username = caplinUsername ?: System.getenv("CAPLIN_USERNAME")
9+
val password = caplinPassword ?: System.getenv("CAPLIN_PASSWORD")
10+
if (username != null || password != null) {
11+
credentials {
12+
this.username = username
13+
this.password = password
14+
}
1115
}
1216
}
1317
}

0 commit comments

Comments
 (0)