Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider making log4j-core an optional / runtimeOnly dependency #790

Closed
sschuberth opened this issue Aug 24, 2022 · 1 comment
Closed

Consider making log4j-core an optional / runtimeOnly dependency #790

sschuberth opened this issue Aug 24, 2022 · 1 comment

Comments

@sschuberth
Copy link
Contributor

My understanding is that the shadow plugin depends on log4j-core not for its own logging (which should be / is done via the Gradle API anyway), but for the Log4j2PluginsCacheFileTransformer. This may lead to confusions about dependency updates for users of the shadow plugin that to not use Log4j in their own application (and consequently also not the shadow plugin's Log4j2PluginsCacheFileTransformer).

To avoid this, I'm wondering whether the dependency on log4j-core could be made optional in some way, e.g. by turning it into a runtimeOnly dependency?

@johnrengelman
Copy link
Owner

runtimeOnly would pull it in regardless.

Not sure how this would work for users as trying to use the transformer would fail with class not found errors if the dependency isn't being resolved.

The right answer is probably that all transformers should be in their own packages that can be added, but that's a lot of effort right now.

I'm going to close this in the meantime as I don't see a way to do this that doesn't create a bad experience for users.

@johnrengelman johnrengelman closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants