Skip to content

Commit 10f4e8d

Browse files
committed
add credentials for nexus
1 parent 2d2d691 commit 10f4e8d

File tree

3 files changed

+14
-21
lines changed

3 files changed

+14
-21
lines changed

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ version = "2.0.0-SNAPSHOT"
44
plugins {
55
kotlin("jvm") version "1.7.20"
66
id("kediatr-publishing") apply false
7-
id("kediatr-signing")
87
id("kediatr-coverage")
98
id("org.jlleitschuh.gradle.ktlint") version "11.0.0"
109
}

buildSrc/src/main/kotlin/kediatr-publishing.gradle.kts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@ plugins {
22
`maven-publish`
33
signing
44
}
5-
5+
fun getProperty(
6+
projectKey: String,
7+
environmentKey: String,
8+
): String? {
9+
return if (project.hasProperty(projectKey)) {
10+
project.property(projectKey) as? String?
11+
} else {
12+
System.getenv(environmentKey)
13+
}
14+
}
615
afterEvaluate {
716
publishing {
817
publications {
@@ -50,21 +59,14 @@ afterEvaluate {
5059
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
5160
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
5261
// url = uri(layout.buildDirectory.dir("mavenlocalpublish"))
62+
credentials {
63+
username = getProperty("nexus_username", "nexus_username")
64+
password = getProperty("nexus_password", "nexus_password")
65+
}
5366
}
5467
}
5568
}
5669

57-
fun getProperty(
58-
projectKey: String,
59-
environmentKey: String,
60-
): String? {
61-
return if (project.hasProperty(projectKey)) {
62-
project.property(projectKey) as? String?
63-
} else {
64-
System.getenv(environmentKey)
65-
}
66-
}
67-
6870
val signingKey = getProperty(projectKey = "gpg.key", environmentKey = "gpg_private_key")
6971
val passPhrase = getProperty(projectKey = "gpg.passphrase", environmentKey = "gpg_passphrase")
7072
signing {

buildSrc/src/main/kotlin/kediatr-signing.gradle.kts

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)