Maven子模块pom.xml配置文件继承父模块配置依赖的问题

2020-03-02  本文已影响0人  Carl_TSNE

一、在父模块pom中使用的导包方式为:

<depedencies>
  ...
</depedencies>

子模块会直接继承父模块中的jar包
此种方式一般用于:在父pom中配置每个模块都需要的jar包及其他配置信息

二、在父模块pom中使用的导包方式为:

<dependencyManagement>
  <dependencies>
    ...
  </dependencies>
</dependencyManagement>

子模块pom不会自动继承父模块pom中的jar包,如果需要使用,就要给出 groupId 和 artifactId,无需给出 version
此种方式由父模块统一管理依赖的版本配置


总结

上一篇 下一篇

猜你喜欢

热点阅读