apache / apache/maven-mvnd

Cannot use Maven plugins that use slf4j-log4j12

Open
#530 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.5k
Forks
250
Avg merge
16h 22m
Merged PRs (30d)
36

Description

If you try to use mvnd with a maven plugin that uses slf4j-log4j12, the build fails with

```
java.lang.IllegalStateException: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError. See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
at org.slf4j.impl.Log4jLoggerFactory.(Log4jLoggerFactory.java:54)
```

due to the presence of log4j-over-slf4j in the daemon classloader.

If I build a version of the daemon without the log4j-over-slf4j-dependency, everything seems to work fine, so that might be an easy fix, but it might be there for a reason?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the mvnd build with a Maven plugin that uses slf4j-log4j12, then inspect the daemon classloader dependency that provides log4j-over-slf4j. Compare the behavior with a daemon built without that dependency; done means the plugin build succeeds without the SLF4J delegation-loop error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.