Springboot创建多module项目--转载
1)create new project ( 或 File --> new --> project)
2)选中Spring Initializr ,点击Next

image.png
3)填写必要信息,点击Next

image.png
4)依赖页不用勾选,点击Next

image.png
5)选择项目存储目录,点击Finish

image.png
6)在pom.xml中加入packaging
<packaging>pom</packaging>
7)删除多余文件

image.png
8)清理、编译、打包
mvn clean install
9)在工程上右键,New-Module

image.png

image.png
10)填写子工程信息

image.png
11)选择依赖,点击Next

image.png
12)点击Finish

image.png
13) 在父级pom.xml中增加modules
<modules>
<module>kafka-producer</module>
</modules>
14) 修改子级pom.xml中的parent节点
<parent>
<groupId>com.example.test</groupId>
<artifactId>kafka-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
14) 删除子module中的多余文件

image.png
15)清理、编译、打包
mvn clean install
参考:
https://blog.csdn.net/longwind8/article/details/118657446
https://www.cnblogs.com/orzlin/p/9717399.html