问题描述
使用Idea maven构建SpringBoot多模块项目。
问题出现的环境背景及自己尝试过哪些方法
我看到网上大部分都是以dao、service这样拆分的,感觉这不是按照系统去拆分。
我尝试着按照不同系统拆分成A、B、C,即每个模块都是有Controller-Service-Dao。
程序启动类,SpringBoot不在这三个Module当中,而是自己又新建了一个Module,放启动类和一些配置文件。
可是这样启动之后,请求A、B、C 模块三个Controller的地址,都没有找到。
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
父工程pom
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
pom
medical-peis
medical-application
org.springframework.boot
spring-boot-starter-parent
2.1.6.RELEASE
com.hysoft
hysoft-medical-system
0.0.1-SNAPSHOT
hysoft-medical-system
Demo project for Spring Boot
1.8
org.springframework.boot
spring-boot-starter-web
mysql
mysql-connector-java
runtime
org.springframework.boot
spring-boot-starter-test
test
org.springframework.boot
spring-boot-maven-plugin
application Module pom文件
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
com.hysoft
hysoft-medical-system
0.0.1-SNAPSHOT
com.hysoft
medical-application
0.0.1-SNAPSHOT
medical-application
Demo project for Spring Boot
1.8
com.hysoft
medical-peis
0.0.1-SNAPSHOT
org.springframework.boot
spring-boot-maven-plugin
repackage
模块A pom文件
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
com.hysoft
hysoft-medical-system
0.0.1-SNAPSHOT
4.0.0
medical-peis