This is an automated email from the ASF dual-hosted git repository.
snazy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push:
new 2a174add Allow overriding the published parent pom's name and
description (#795)
2a174add is described below
commit 2a174addbba0403815b7917b01fdbfd99f6dc39a
Author: Robert Stupp <[email protected]>
AuthorDate: Tue Jan 21 13:49:36 2025 +0100
Allow overriding the published parent pom's name and description (#795)
The publishing-helper in Polaris derives the name and description used in
the parent POM from ASF's published project information. If an Apache projects
wants to publish the parent pom for a _related_ project, the name and
description in the pom (may) need to be different (as for #785). This change
allows this.
---
build-logic/src/main/kotlin/publishing/PublishingHelperExtension.kt | 2 ++
build-logic/src/main/kotlin/publishing/configurePom.kt | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git
a/build-logic/src/main/kotlin/publishing/PublishingHelperExtension.kt
b/build-logic/src/main/kotlin/publishing/PublishingHelperExtension.kt
index 7363a15e..419f6afb 100644
--- a/build-logic/src/main/kotlin/publishing/PublishingHelperExtension.kt
+++ b/build-logic/src/main/kotlin/publishing/PublishingHelperExtension.kt
@@ -37,6 +37,8 @@ abstract class PublishingHelperExtension
constructor(objectFactory: ObjectFactory, project: Project) {
// the following are only relevant on the root project
val asfProjectName =
objectFactory.property<String>().convention(project.name)
+ val overrideName = objectFactory.property<String>()
+ val overrideDescription = objectFactory.property<String>()
val baseName =
objectFactory
.property<String>()
diff --git a/build-logic/src/main/kotlin/publishing/configurePom.kt
b/build-logic/src/main/kotlin/publishing/configurePom.kt
index 47088b31..13ac211a 100644
--- a/build-logic/src/main/kotlin/publishing/configurePom.kt
+++ b/build-logic/src/main/kotlin/publishing/configurePom.kt
@@ -107,8 +107,8 @@ internal fun configurePom(project: Project,
mavenPublication: MavenPublication,
}
issueManagement { url.set(projectPeople.bugDatabase) }
- name.set(projectPeople.name)
- description.set(projectPeople.description)
+ name.set(e.overrideName.orElse(projectPeople.name))
+
description.set(e.overrideDescription.orElse(projectPeople.description))
url.set(projectPeople.website)
inceptionYear.set(projectPeople.inceptionYear.toString())