Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion build-logic/src/main/kotlin/publishing/configurePom.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ internal fun configurePom(project: Project, mavenPublication: MavenPublication,

task.doFirst {
mavenPom.run {
val gitInfo = GitInfo.memoized(project)
val asfProject = AsfProject.memoized(project, e.asfProjectId.get())
val asfProjectId = asfProject.apacheId

Expand All @@ -85,7 +86,14 @@ internal fun configurePom(project: Project, mavenPublication: MavenPublication,
licenses {
license {
name.set("Apache-2.0") // SPDX identifier
url.set(asfProject.licenseUrl)
url.set(gitInfo.rawGithubLink("LICENSE"))
comments.set(
"""
NOTICE: ${gitInfo.rawGithubLink("NOTICE")}
DISCLAIMER: ${gitInfo.rawGithubLink("DISCLAIMER")}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding these links for release builds sounds valuable to me, but given current impl. of GitInfo for non-release builds (using HEAD) I do not think the links would be useful or even correct.

Could we identity whether GetInfo has a solid tag and avoid adding links if it does not?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link would be correct (e.g. https://raw.githubusercontent.com/apache/polaris/$rawLinkRef/$file translates to https://raw.githubusercontent.com/apache/polaris/HEAD/LICENSE) in case it's not a release.
I don't see a better alternative than HEAD here for non-release builds, as the Git commit SHA could be from "anywhere".

However, the referenced files are probably not the right ones for the root pom.

Hm - maybe let's drop this PR. I'll leave it open for a bit, but it looks like it's incorrect.

"""
.trimIndent()
)
}
}
mailingLists {
Expand Down