一、将项目模块化,拆分更小的单元,每个单元不同功能。
主要功能配置:
二、实现:
1、将项目的pom.xml 里面你的packaging节点改成pom,以下
<packaging>pom</packaging>
2、项目新建 new >module ,新建web模块
3、将web功能相关的模块直接拖到新建的web模块里面,如下:
都移植过来之后,项目中的src目录就可以删除了。
4、同样新建model、persistence模块,一样操作
可以发现石油错误的,因为相关依赖没有调整好。主要是web 依赖于persistence,persistence依赖于model
5、调整依赖,在persistence的pom.xml中添加model的依赖,在web的pom.xml中添加persistence的依赖,如下:
6、运行成功
7、项目打包