Woodchuck
Woodchuck

Reputation: 4414

log4j2-slf4j-impl duplicate dependencies

I have a Maven project where I would like to use log4j2 with slf4j. So I add this dependency:

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-slf4j-impl</artifactId>
  <version>2.11.2</version>
</dependency>

It seems to work as far as I can tell. But my question is in regard to log4j-slf4j-impl's transitive dependencies.

Why does IntelliJ show that log4j-core brings in log4j-api, but then omits it due to being a duplicate (which I believe the below screenshot is saying)? And how can I prevent that?

enter image description here

Upvotes: 0

Views: 306

Answers (1)

dunni
dunni

Reputation: 44535

As you can see, log4j-slf4j-impl itself also has a direct dependency to log4j-api, that's why IntelliJ shows that the transitive dependency to it from log4j-core was omitted. There is nothing to prevent, since this is a completely normal behaviour of Maven handling transitive dependencies when they are also included directly on another level.

Upvotes: 1

Related Questions