Is there anyway to exclude artifacts inherited from a parent POM?

后端 未结 9 1218
礼貌的吻别
礼貌的吻别 2020-11-30 22:02

Artifacts from dependencies can be excluded by declaring an element inside a But in this case it\'s needed to

9条回答
  •  遥遥无期
    2020-11-30 22:30

    Some ideas:

    1. Maybe you could simply not inherit from the parent in that case (and declare a dependency on base with the exclusion). Not handy if you have lot of stuff in the parent pom.

    2. Another thing to test would be to declare the mail artifact with the version required by ALL-DEPS under the dependencyManagement in the parent pom to force the convergence (although I'm not sure this will solve the scoping problem).

    
      
            
          javax.mail
          mail
          ???
        
      
    
    
    1. Or you could exclude the mail dependency from log4j if you're not using the features relying on it (and this is what I would do):
    
      log4j
      log4j
      1.2.15
      provided
      
        
          javax.mail
          mail
        
        
          javax.jms
          jms
        
        
          com.sun.jdmk
          jmxtools
        
        
          com.sun.jmx
          jmxri
        
      
    
    
    1. Or you could revert to the version 1.2.14 of log4j instead of the heretic 1.2.15 version (why didn't they mark the above dependencies as optional?!).

提交回复
热议问题