4.0.0com.examplespringboot-multi0.0.1-SNAPSHOTpomspringboot-multiDemo project for Spring Bootwebservicedaoentityorg.springframework.bootspring-boot-starter-parent1.5.10.RELEASEUTF-8UTF-81.8org.springframework.bootspring-boot-starter-weborg.apache.maven.pluginsmaven-compiler-plugin3.1${java.version}${java.version}org.apache.maven.pluginsmaven-surefire-plugin2.19.1true
六、web子模块pom.xml(依赖service、dao、entity子模块)
4.0.0com.exampleweb0.0.1-SNAPSHOTjarwebDemo project for Spring Bootcom.examplespringboot-multi0.0.1-SNAPSHOT../pom.xmlcom.exampleservice0.0.1-SNAPSHOTcom.exampledao0.0.1-SNAPSHOTcom.exampleentity0.0.1-SNAPSHOTorg.springframework.bootspring-boot-maven-plugincom.example.WebApplicationZIPrepackage
七、service子模块pom.xml(依赖 dao 、entity子模块)
4.0.0com.exampleservice0.0.1-SNAPSHOTjarserviceDemo project for Spring Bootcom.examplespringboot-multi0.0.1-SNAPSHOT../pom.xmlcom.exampledao0.0.1-SNAPSHOTcom.exampleentity0.0.1-SNAPSHOT
八、dao子模块pom.xml (依赖entity子模块)
4.0.0com.exampledao0.0.1-SNAPSHOTjardaoDemo project for Spring Bootcom.examplespringboot-multi0.0.1-SNAPSHOT../pom.xmlcom.exampleentity0.0.1-SNAPSHOT
九、entity子模块
4.0.0com.exampleentity0.0.1-SNAPSHOTjarentityDemo project for Spring Bootcom.examplespringboot-multi0.0.1-SNAPSHOT../pom.xml
十、pom.xml文件中需要注意的就是:
主项目的modules标签指定的子模块是否正确
子模块之间的依赖
子模块的parent标签
十一、web子模块的Application启动类:
@RestController
@SpringBootApplication
public class WebApplication {
public static void main(String[] args) {
SpringApplication.run(WebApplication.class, args);
}
@RequestMapping(value = "/test",method = RequestMethod.GET)
public String test(){
return "test success";
}
}