Maven 2 - define dependency version from transitive dependency version

后端 未结 3 1281
慢半拍i
慢半拍i 2020-12-17 04:20

I\'ll explain the question with my real situation.

I use logback 1.0.1 for logging, and it includes SLF4J 1.6.4 as a dependency. I also use the SLF4J API bridges for

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-17 04:36

    Not in a very beautiful way :/

    There is the maven enforcer plugin: http://maven.apache.org/enforcer/enforcer-rules/

    so you can ban the transitive dependencies and include the version you want: http://maven.apache.org/enforcer/enforcer-rules/bannedDependencies.html

    If you use a property for the good version you dont need to mess around in the enforcer plugin version.

提交回复
热议问题