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

后端 未结 9 1244
礼貌的吻别
礼貌的吻别 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:57

    When you call a package but do not want some of its dependencies you can do a thing like this (in this case I did not want the old log4j to be added because I needed to use the newer one):

    
      package
      package-pk
      ${package-pk.version}
    
      
        
          org.apache.logging.log4j
          log4j-core
        
        
          org.apache.logging.log4j
          log4j-api
        
      
    
    
    
    
      org.apache.logging.log4j
      log4j-core
      2.5
    
    
      org.apache.logging.log4j
      log4j-api
      2.5
    
    

    This works for me... but I am pretty new to java/maven so it is maybe not optimum.

提交回复
热议问题