Skip to content

Align Log4j across published BOMs - #16045

Open
jamesfredley wants to merge 1 commit into
7.0.xfrom
deps/align-log4j-boms-7.0.x
Open

Align Log4j across published BOMs#16045
jamesfredley wants to merge 1 commit into
7.0.xfrom
deps/align-log4j-boms-7.0.x

Conversation

@jamesfredley

Copy link
Copy Markdown
Contributor

Description

Follow-up to merged PR #16043. That PR correctly upgraded Log4j to 2.25.5, but its CI run exposed two publication issues that this change resolves:

  • Log4j 2.25.5 transitively selects biz.aQute.bnd.annotation:7.1.0, while Spring Boot 3.5.16 manages 7.0.0. The shared Grails BOM maps now manage the winning 7.1.0 version, fixing Validate Dependency Versions.
  • Log4j management now lives in the shared Gradle BOM maps and every published BOM imports log4j-bom before inherited platforms. This prevents Maven's first-import-wins behavior and Gradle enforcedPlatform variants from leaving non-explicit Log4j modules at Spring Boot's older 2.24.3 version.

The affected publications are:

  • grails-gradle-bom
  • grails-base-bom
  • grails-bom
  • grails-hibernate5-bom
  • grails-micronaut-bom

Verification

  • Root POM generation plus all dependency validators: 216 tasks successful.
  • Grails Gradle POM generation plus all dependency validators: 11 tasks successful.
  • Generated Gradle, base, Hibernate 5, and Micronaut POMs import log4j-bom before Spring Boot/Grails/Micronaut inherited platforms.
  • A temporary real Gradle consumer imported each of the five published BOM POMs and resolved the non-explicit org.apache.logging.log4j:log4j-layout-template-json module to 2.25.5 in every case.
  • git diff --check passes.

Generative AI tooling was used to assist with dependency analysis, generated-POM verification, consumer resolution testing, review, and PR preparation. The resulting changes were reviewed and verified by the submitter.

Move Log4j 2.25.5 management into the shared Gradle BOM maps and import
the Log4j BOM first from every published BOM so Maven and Gradle consumers
receive the fixed version across the complete family.

Manage biz.aQute.bnd.annotation 7.1.0, which Log4j 2.25.5 requires, so
the dependency version validator matches the winning transitive version.

Assisted-by: opencode:gpt-5.6-sol codegraph
Copilot AI review requested due to automatic review settings July 23, 2026 00:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Aligns Log4j dependency management across the Grails published BOMs to ensure Log4j 2.25.5 (and its transitive Bnd annotation version) consistently wins over Spring Boot’s older managed versions, including in scenarios where BOM import order matters.

Changes:

  • Adds log4j-bom as an explicit, first-imported platform in each published BOM’s dependencies block (before Spring Boot / inherited platforms).
  • Centralizes Log4j and Bnd annotation version management into the shared Gradle BOM maps in dependencies.gradle, and wires log4j2-bom into gradleBomPlatformDependencies / combinedPlatforms.
  • Moves Log4j module coordinates into the shared Gradle BOM dependency map so they are consistently available across publications.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
grails-gradle/bom/build.gradle Imports log4j2-bom before spring-boot-bom to ensure Maven/Gradle BOM ordering favors Log4j 2.25.5.
grails-bom/base/build.gradle Imports log4j2-bom before spring-boot-bom for the base Grails BOM publication chain.
grails-bom/hibernate5/build.gradle Adds early log4j2-bom import so Hibernate 5 BOM consumers inherit Log4j 2.25.5 management consistently.
grails-bom/micronaut/build.gradle Adds early log4j2-bom import so Micronaut BOM layering doesn’t regress Log4j module versions.
dependencies.gradle Adds bnd.version (7.1.0), defines log4j2-bom in shared Gradle BOM platform map, and moves Log4j management into the shared Gradle BOM maps used by published BOMs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@testlens-app

testlens-app Bot commented Jul 23, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 811faed
▶️ Tests: 28902 executed
⚪️ Checks: 52/52 completed


Learn more about TestLens at testlens.app.

@jamesfredley jamesfredley moved this to Todo in Apache Grails Jul 24, 2026
@borinquenkid borinquenkid added this to the grails:7.0.15 milestone Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

4 participants