How to include dependency with 'provided' scope with maven-assembly-plugin

前端 未结 5 546
被撕碎了的回忆
被撕碎了的回忆 2021-02-01 18:27

I am fighting with maven to include a managed dependency with \'provided\' scope into tar file by using the maven-assembly-plugin.

I use super parent pom file as a base

5条回答
  •  误落风尘
    2021-02-01 18:42

    You can override a managed dependency by declaring it inside a tag in the POM where you want it to be overridden.

    In your case, you should add the following to your child pom:

    
        
            log4j
            log4j
            ${log4j.version}
            provided
        
    
    

    Note that this overrides everything declared in the parent POM's dependency management, i.e. you cannot leave version or scope undeclared and expect it to be inherited.

提交回复
热议问题