Skip to content

Commit 8024a5c

Browse files
committed
build: include SCM and URL Maven metadata in generated POMs
This hopefully helps tools such as dependabot or renovate to pick up changelog information from the repo.
1 parent be1808a commit 8024a5c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

build.gradle.kts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,25 @@ subprojects {
116116
}
117117
}
118118
}
119+
120+
// Set maven metadata for all known publishing tasks. The exact tasks and names are only known after evaluatin.
121+
afterEvaluate {
122+
tasks.withType<AbstractPublishToMaven>() {
123+
this.publication?.apply {
124+
setMetadata()
125+
}
126+
}
127+
}
128+
}
129+
130+
fun MavenPublication.setMetadata() {
131+
pom {
132+
url.set("https://github.com/modelix/modelix.core")
133+
scm {
134+
connection.set("scm:git:https://github.com/modelix/modelix.core.git")
135+
url.set("https://github.com/modelix/modelix.core")
136+
}
137+
}
119138
}
120139

121140
tasks.withType<org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask> {
@@ -256,6 +275,8 @@ publishing {
256275
groupId = "org.modelix"
257276
artifactId = "core-version-catalog"
258277
from(components["versionCatalog"])
278+
279+
setMetadata()
259280
}
260281
}
261282
}

0 commit comments

Comments
 (0)