父子模块和父子pom的概念
两个概念很容易混淆,但在pom文件中是不同的概念
子模块概念
这个目录属于父项目的一部分
父项目构建时会包含这个子模块
子 POM概念
子项目使用父项目的 <dependencyManagement> 管理依赖版本
子项目继承父项目的配置(properties、plugins 等)
通过 <parent> 标签声明
父子模块的申明通过在父pom文件的module中申明
在父模块java-ai.pom文件的module中申明employee-management只代表employee-management.pom是java-ai.pom的子模块,而不是子pom
<modules>
<module>first-step-servlet-http</module>
<module>employee-management</module>
</modules>
父子pom文件的申明通过在子模块pom文件的parent中申明父pom
例如在子模块employee-management.pom的parent中申明spring-boot为父pom,那么employee-management.pom就是spring-boot的子pom
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.0</version>
<relativePath/>
</parent>