feat: flatten non-BOM artifacts
This change introduces a new execution of the Flatten Maven Plugin for non-BOM modules, aimed at simplifying their published POMs while preserving important metadata and build integrity.
Key changes
-
Applies
cleanmode, removing most optional POM elements. -
Retains key elements:
<name>,<description>, and<url>are expanded to preserve meaningful metadata and prevent undesirable URL inheritance (i.e., appendingartifactIdto the parent URL).<license>is preserved in each module for clarity and utility.
-
Keeps the
<parent>element so modules continue to inherit metadata anddependencyManagementfromlog4j-bomand their direct ancestors. -
<properties>are removed, but<dependencies>and<dependencyManagement>are retained with interpolated values to avoid unresolved variables in the flattened POMs.
Differences from the clean mode
- Keeps
nameanddescriptionper module to aid discoverability. - Delegates all contact and project metadata (organization, developers, mailing lists, SCM, issue tracker, CI config, etc.) to the centralized
log4j-bomPOM. - Preserves
dependencyManagementsections by interpolating versions, rather than removing them. - Retains non-transitive scopes (
provided,test) to expose compile/test-time dependencies, even if consumers don't require them.
This flattening strategy reduces noise in published POMs while maintaining enough structure for clarity and downstream tool compatibility.
Another advantage of this approach is that the Flatten Maven Plugin computes the effective POM using the already flattened parent POMs, unlike Maven’s reactor, which uses the source POM files. This helps catch issues early and prevents unresolved properties from being accidentally propagated into the published POMs.
While this change will likely belong in logging-parent eventually, this PR is currently targeted here (and marked as a draft) for two main reasons:
- To allow for experimentation and validation before moving it upstream to
logging-parent. - To make it available in
2.25.2without incurring the additional overhead of releasing a new version oflogging-parent.