Skip to content

Dependency convergence error on log4j-core-test #1908

@Edhilion

Description

@Edhilion

Description

When I try to build my project using log4j-core-test via maven, the following error is displayed :

[ERROR] Rule 0: org.apache.maven.enforcer.rules.dependency.DependencyConvergence failed with message:
[ERROR] Failed while enforcing releasability.
[ERROR] 
[ERROR] Dependency convergence error for org.hamcrest:hamcrest:jar:2.1 paths to dependency are:
[ERROR] +-com.me.mypackage:myapp:jar:2.0.1-SNAPSHOT
[ERROR]   +-org.apache.logging.log4j:log4j-core-test:jar:2.21.1:compile
[ERROR]     +-org.awaitility:awaitility:jar:4.2.0:compile
[ERROR]       +-org.hamcrest:hamcrest:jar:2.1:compile
[ERROR] and
[ERROR] +-com.me.mypackage:myapp:jar:2.0.1-SNAPSHOT
[ERROR]   +-org.apache.logging.log4j:log4j-core-test:jar:2.21.1:compile
[ERROR]     +-org.hamcrest:hamcrest:jar:2.2:compile

And I must keep a strict dependency rule.
I know I can simply force hamcrest to 2.2 in my pom.xml, or exclude it from the file, but I don't want to do it to solve a dependency problem that is not on my side.

Please can you fix it on your side, or better, get rid of awaitility, which hasn't been updated since 2022 ?

Configuration

Version: 2.21.1

Operating system: Ubuntu 20.04.6 LTS

JDK: openjdk 11.0.20.1 2023-08-24

Logs

After a simple mvn clean install command.

[ERROR] Rule 0: org.apache.maven.enforcer.rules.dependency.DependencyConvergence failed with message:
[ERROR] Failed while enforcing releasability.
[ERROR] 
[ERROR] Dependency convergence error for org.hamcrest:hamcrest:jar:2.1 paths to dependency are:
[ERROR] +-com.me.mypackage:myapp:jar:2.0.1-SNAPSHOT
[ERROR]   +-org.apache.logging.log4j:log4j-core-test:jar:2.21.1:compile
[ERROR]     +-org.awaitility:awaitility:jar:4.2.0:compile
[ERROR]       +-org.hamcrest:hamcrest:jar:2.1:compile
[ERROR] and
[ERROR] +-com.me.mypackage:myapp:jar:2.0.1-SNAPSHOT
[ERROR]   +-org.apache.logging.log4j:log4j-core-test:jar:2.21.1:compile
[ERROR]     +-org.hamcrest:hamcrest:jar:2.2:compile

Reproduction

mvn clean install on any project with strict dependency Maven Enforcer Plugin (https://maven.apache.org/enforcer/enforcer-rules/dependencyConvergence.html).

Let me know if you need a full live project to reproduce.

Cheers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicatePull requests or issues with another instance elsewhere

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions