Skip to content

Decouple enforceBytecodeVersion ITs from the log4j-api fixture version - #1018

Merged
slachiewicz merged 1 commit into
masterfrom
decouple-bytecode-version-its-from-log4j
Aug 27, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
decouple-bytecode-version-its-from-log4j

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

The enforce-bytecode-version-multirelease and enforce-bytecode-version-multirelease-strict IT projects pinned the log4j-api version twice: once in the POM and again inside the verify.groovy assertions. Every fixture upgrade therefore required touching both files in sync, and a POM-only change failed the IT verification.

This PR moves the version into a <log4j.version> property and makes the assertions version-agnostic (anchored regexes on the log4j-api artifact), which decreases the maintenance cost of the ITs:

  • future fixture bumps become a one-line POM change and can never desynchronise the verification scripts
  • the tests keep asserting exactly the behaviour they exist for: analysis of multi-release JARs, module-info ignoring when maxJdkVersion < 9, and the strict-mode ban of classes above the maximum JDK
  • both fixtures are refreshed to log4j-api 2.25.5

Testing:

  • ran both IT projects locally against maven-enforcer-plugin 3.6.4-SNAPSHOT: multirelease passes, strict fails as required by its invoker.buildResult = failure, and the executed verify scripts pass in both cases

  • verified the refactored scripts pass with the property set to both 2.17.2 and 2.25.5 (property-only change) and still fail when the expected log lines are absent

  • Your pull request should address just one issue, without pulling in other changes.

  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.

  • Each commit in the pull request should have a meaningful subject line and body.

  • You have run the integration tests successfully (mvn -Prun-its verify) for the affected projects.

  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004

@slachiewicz slachiewicz added dependencies Pull requests that update a dependency file java Pull requests that update Java code labels Aug 27, 2026
The IT POMs and their verify scripts both pinned the exact log4j-api
version, so every fixture upgrade required touching the two files in
sync, and a POM-only bump failed the IT verification.

Move the version into a <log4j.version> property and make the script
assertions match the artifact regardless of its version. Bumping the
fixture is now a one-line POM change, decreasing the maintenance cost,
while the tests keep asserting the actual rule behaviour: analysis of
multi-release JARs, module-info ignoring below Java 9 and the strict
mode ban of classes above the maximum JDK.

Both projects are refreshed to log4j-api 2.25.5.
@slachiewicz
slachiewicz force-pushed the decouple-bytecode-version-its-from-log4j branch from 0d6f901 to df4370a Compare August 27, 2026 22:37
@slachiewicz
slachiewicz merged commit a4e30b9 into master Aug 27, 2026
21 checks passed
@slachiewicz
slachiewicz deleted the decouple-bytecode-version-its-from-log4j branch August 27, 2026 23:12
@github-actions github-actions Bot added this to the 3.6.4 milestone Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file java Pull requests that update Java code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant