Skip to content

Commit 319afa4

Browse files
committed
ignore example project for publishing of modules
Co-authored-by: Matthias Geißendörfer <[email protected]>
1 parent 1a6d70e commit 319afa4

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

buildSrc/src/main/kotlin/babbage.conventions.gradle.kts

+14-13
Original file line numberDiff line numberDiff line change
@@ -92,24 +92,25 @@ tasks.register<Jar>("sourcesJar") {
9292
}
9393

9494
publishing {
95-
repositories {
96-
maven {
97-
name = "GitHubPackages"
98-
url = uri("https://maven.pkg.github.com/otto-de/babbage-microservice")
99-
credentials {
100-
username = (findProperty("github_username") as String?) ?: System.getenv("GITHUB_USERNAME")
101-
password = (findProperty("github_token") as String?) ?: System.getenv("GITHUB_TOKEN")
95+
if (!base.archivesName.get().contains("example")) {
96+
repositories {
97+
maven {
98+
name = "GitHubPackages"
99+
url = uri("https://maven.pkg.github.com/otto-de/babbage-microservice")
100+
credentials {
101+
username = (findProperty("github_username") as String?) ?: System.getenv("GITHUB_USERNAME")
102+
password = (findProperty("github_token") as String?) ?: System.getenv("GITHUB_TOKEN")
103+
}
102104
}
103105
}
104-
}
105106

106-
publications {
107-
create<MavenPublication>(base.archivesName.get()) {
108-
from(components["java"])
109-
artifact(tasks["sourcesJar"])
107+
publications {
108+
create<MavenPublication>(base.archivesName.get()) {
109+
from(components["java"])
110+
artifact(tasks["sourcesJar"])
111+
}
110112
}
111113
}
112-
113114
}
114115

115116
/**

0 commit comments

Comments
 (0)