Maven build [WARNING] we have a duplicate class

前端 未结 8 1280
醉话见心
醉话见心 2020-12-03 16:30

Anybody has any idea what happened to my maven build? I am getting a lot of duplicate warnings.

[WARNING] We have a duplicate org/apache/commons/logging/impl         


        
8条回答
  •  悲哀的现实
    2020-12-03 17:15

    In my case I was relying on a package that also creates a shaded jar.

    Shaded jars are meant for deployment, not installing as a dependency.

    Creating a reduced dependency POM during the build process of the dependency, instructs maven on which dependencies can be left out.

    In the maven-shade-plugin configuration:

    
      false
    
    

    For more details see this post:

    What is the maven-shade-plugin used for, and why would you want to relocate java packages?

    The error I was getting from maven:

    WARNING: x.jar, y.jar contain overlapping classes

提交回复
热议问题