Is there a way to exclude a Maven dependency globally?

后端 未结 4 484
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-30 20:53

I’m trying to find a “generic” way of excluding a transitive dependency from being included without having to exclude it from all the dependencies that depend on it. For ex

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-30 21:14

    I created an empty jar and created this dependency:

    
        commons-logging
        commons-logging
        system
        ${basedir}/src/lib/empty.jar
        0
    
    

    It is not perfect because from now on you have an empty jar in your compile/test path. But that is just cosmetic.

提交回复
热议问题