Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8712203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:03:45+00:00 2026-06-13T05:03:45+00:00

In the example Maven dependencies below, the slf4j dependency wants to pull in log4j

  • 0

In the example Maven dependencies below, the slf4j dependency wants to pull in log4j 1.2.17 and the log4j explicit dependency wants to pull in 1.2.15. Maven resolves log4j to version 1.2.15 however, there are no warnings that Maven prints out that sl4j wants a later version of log4j.

How can I get Maven to warn about these types of conflicts, rather than just silently take the
1.2.15 version?

<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-log4j12</artifactId>
  <version>1.7.2</version>
</dependency>
<dependency>
  <groupId>log4j</groupId>
  <artifactId>log4j</artifactId>
  <version>1.2.15</version>
</dependency>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:03:46+00:00Added an answer on June 13, 2026 at 5:03 am

    In short, Maven-enforcer-plugin should be used to handle this.

    You’d just need to configure the enforcer plugin like

    <project>
      ...
      <build>
        <plugins>
          ...
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>1.1.1</version>
            <executions>
              <execution>
                <id>enforce</id>
                <configuration>
                  <rules>
                    <DependencyConvergence/>
                  </rules>
                </configuration>
                <goals>
                  <goal>enforce</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          ...
        </plugins>
      </build>
      ...
    </project>
    

    In more detail, as told in the documentation page, something like this that has a transative dependency mismatch:

    <dependencies>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jdk14</artifactId>
        <version>1.6.1</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-nop</artifactId>
        <version>1.6.0</version>
      </dependency>
    </dependencies>  
    

    will silently “work” without the enforcer rule, but with the rule set up, it’ll fail the build with

    Dependency convergence error for org.slf4j:slf4j-api1.6.1 paths to dependency are:
    
    [ERROR]
    Dependency convergence error for org.slf4j:slf4j-api:1.6.1 paths to dependency are:
    +-org.myorg:my-project:1.0.0-SNAPSHOT
      +-org.slf4j:slf4j-jdk14:1.6.1
        +-org.slf4j:slf4j-api:1.6.1
    and
    +-org.myorg:my-project:1.0.0-SNAPSHOT
      +-org.slf4j:slf4j-nop:1.6.0
        +-org.slf4j:slf4j-api:1.6.0
    

    thus, when user gets the error message about the failed build, she can fix it by doing an exclusion, like

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <version>1.6.1</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-nop</artifactId>
      <version>1.6.0</version>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my Maven pom.xml I have the following dependencies: <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>3.3.2.GA</version> </dependency>
For example, let's say I have a Maven build file that has dependencies located
Can we dynamically load dependencies using maven. For example, lets say we have a
Are there any preexisting Maven plugins or commands to update the dependencies in the
We've been using maven dependencies to specify the libraries so far, i.e.: <dependency> <groupId>org.hibernate</groupId>
I need and example of how to integrate Maven, Spring MVC, LessCss and Wro4j
I am new to maven and I am trying to follow this example but
Im having a problem with a multimodule project in maven/jenkins. For example my structure
How can I change the name from 1.0.snapshot-jar-with-dependencies to something else, below are contents
I am trying to figure out how to aggregate my maven dependencies in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.