Maven build [WARNING] we have a duplicate class

前端 未结 8 1277
醉话见心
醉话见心 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:29

    In my case, my parent pom was including commons-beanutils and my child module (which is the only thing I wanted to compile) was including commons-io.

    The shade plug in complained about duplicates since commons-io and commons-beansutil shared some common classes. Note that beansutiul was being included even though it was not needed, and was not used.

    I solve this by minimizing the jar by adding this to the configuration:

    true
    

    Now the shade plugin did not add unused resources.

    Warning went away.

提交回复
热议问题