Maven dependency: exclude one class

后端 未结 3 1074
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-18 20:53

For example I have dependency:


    org.slf4j
    slf4j-api
    

        
3条回答
  •  盖世英雄少女心
    2020-12-18 21:36

    Excluding a single class in not possible. Within tags you can define . However, these are for entire dependencies.

    The shade plugin should be handled with care. Generally, it's not good practice to be creating a jar containing all your dependencies in one place as it tends to lead to problems if you are to be using the produced artifact in another project as a dependency. For example, shading slf4j in your jar and then depending on your artifact in another project where you have another slf4j will bring you grief.

提交回复
热议问题