1.模块结构
其中dao模块依赖common,service依赖于dao,web依赖于service,web是启动类所以在web的pom文件引入
<build>
<finalName>single-springboot</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.5.RELEASE</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.2</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
并在其他模块里将pom文件的打包改为 <packaging>jar</packaging>
最后运行maven的package命令即可