Repository navigation
Replace the Log4j setLevel Refaster template with its generated recipe - #304
Merged
Merged
Conversation
kmccarp
force-pushed
the
log4j1-imperative
branch
from
September 1, 2026 21:37
5fe2b0a to
e641e9e
Compare
shanman190
approved these changes
Sep 1, 2026
kmccarp
force-pushed
the
log4j1-imperative
branch
from
September 1, 2026 21:51
e641e9e to
aeed662
Compare
This was referenced Sep 2, 2026
Merged
Merged
Merged
Merged
Resolve org.openrewrite build plugins from the Code Genome Project
openrewrite/rewrite-dropwizard#30
Merged
Merged
Merged
Merged
Merged
Merged
Merged
This was referenced Sep 2, 2026
Resolve org.openrewrite build plugins from the Code Genome Project
openrewrite/rewrite-micronaut#149
Merged
Merged
Merged
Merged
Merged
Merged
Merged
Resolve org.openrewrite build plugins from the Code Genome Project
openrewrite/rewrite-recipe-bom#71
Merged
Merged
Merged
kmccarp
force-pushed
the
log4j1-imperative
branch
from
September 2, 2026 11:54
aeed662 to
eafc234
Compare
Merged
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background / problem
The vulnerability scan flags
log4j:log4j1.2.17 in this repo with six CRITICAL-rated Log4j 1.x advisories. The jar was oncompileClasspathfor exactly one reason:LoggerSetLevelToConfiguratorwas a Refaster template whose@BeforeTemplatesignature namesorg.apache.log4j.Loggerandorg.apache.log4j.Levelas parameter types, so the compiler needed the classes. Every other Log4j 1.x reference in the repo is a string, which needs nothing at compile time.Keeping the jar meant keeping a repo-local
suppressions.xmlfor it and renewing that suppression every month. It lapsed today.Solution
Replaces the Refaster template with the imperative recipe
rewrite-templatinggenerates from it, committed as ordinary source. With no compile-time consumer left, thecompileOnly("log4j:log4j:1.+")dependency and thesuppressions.xmlthat existed for it are both deleted.Also adds the Code Genome Project to
pluginManagement, sincerewrite-build-gradle-plugin2.23.2 depends on rewrite releases published only there and the build cannot resolve otherwise. The block is skipped when no credentials are configured.Test plan
compileJavaandcompileTestJavapass with Log4j 1.x offcompileClasspathorg.openrewrite.java.logging.log4j.*tests pass, 26 tests including thesetLevelcase inLog4j1ToLog4j2Testlog4j:log4jagainst this repo