Exclude classes from a dependency in Maven

后端 未结 2 1410
自闭症患者
自闭症患者 2020-12-10 04:06

I have a project which depends on an artifact which is controlled by a supplier. This artifact contains some classes that I depend on, and some which are older and causing p

2条回答
  •  渐次进展
    2020-12-10 05:09

    Since version 2.0.9 maven preserves the classpath ordering so if you define your patched classes in a jar BEFORE the supplier jar it will hide the supplier implementation.

    Alternatively you can look at the maven shade plugin as it does exactly what you are asking according to me.

提交回复
热议问题