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文件中需要注意的就是:
主項(xiàng)目的modules標(biāo)簽指定的子模塊是否正確
子模塊之間的依賴
子模塊的parent標(biāo)簽
十一、web子模塊的Application啟動(dòng)類:
@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";
}
}