Maven: 父pom的dependencyManagement中配置exclusions能影响子pom吗?

譬如在parent pom中有下面内容

<dependencyManagement>
  <dependency>  
    <groupId>com.baomidou</groupId>  
    <artifactId>mybatis-plus-boot-starter</artifactId>  
    <version>${mybatis-version}</version>  
    <exclusions> 
      <exclusion> 
        <groupId>com.zaxxer</groupId>  
        <artifactId>HikariCP</artifactId>  
      </exclusion> 
    </exclusions>
  </dependency>
</dependencyManagement>

那么在子pom中直接引入

  <dependency>  
    <groupId>com.baomidou</groupId>  
    <artifactId>mybatis-plus-boot-starter</artifactId>  
  </dependency>
  

会继承父pom中的exclusions吗?

阅读 9.9k
1 个回答

会的,dependencyManagement是子模块依赖的管理

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题