Skip to content

Commit 737570f

Browse files
committed
Maven publication: Produce correct <scm><tag> in pom.xml
`project.scm.tag` in a Maven pom is intended to refer to the SCM (Git) tag. We currently publish `main`, which is incorrect. This change omits the SCM tag for snapshot builds, but emits the Git tag for releases.
1 parent b892705 commit 737570f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build-logic/src/main/kotlin/publishing/configurePom.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ internal fun configurePom(project: Project, mavenPublication: MavenPublication,
103103
connection.set("scm:git:$codeRepo")
104104
developerConnection.set("scm:git:$codeRepo")
105105
url.set("$codeRepo/tree/main")
106-
tag.set("main")
106+
val version = project.version.toString()
107+
if (!version.endsWith("-SNAPSHOT")) {
108+
tag.set("apache-polaris-$version")
109+
}
107110
}
108111
issueManagement { url.set(projectPeople.bugDatabase) }
109112

0 commit comments

Comments
 (0)