新建父级项目

IDEA 中创建SpringBoot 父子模块的实现

IDEA 中创建SpringBoot 父子模块的实现

IDEA 中创建SpringBoot 父子模块的实现

父级模块添加完成!

添加子模块

在父级模块又击 选择 new ==> Moudule

IDEA 中创建SpringBoot 父子模块的实现

创建方式与父级模块创建大致一致,唯一不同的是将 Type 改为 Maven Project

IDEA 中创建SpringBoot 父子模块的实现

IDEA 中创建SpringBoot 父子模块的实现

打开父级项目 demo-parent 下的pom.xml 文件
复制以下三行配置信息

IDEA 中创建SpringBoot 父子模块的实现

打开子项目 demo-son 下的pom.xml文件
将parent 节点下的前三行代码替换成为刚刚复制的那三行,如下显示

IDEA 中创建SpringBoot 父子模块的实现

最后,在demo-parent 模块下 的pom.xml文件下新建modules节点,并添加子模块

 <modules>
        <module>demo-son</module>
 </modules>

至此,父子模块搭建完成 demo-son 的父级模块为demo-parent ,而demo-parent 拥有了一个子模块 demo-son

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。