使用到了Maven的高级部分内容;

image.png
多模块项目结构:多个子模块继承一个父模块构成一个完整的项目;

1,持久层(DAO)模块:

image.png

A,持久层模块必须与实体类模块建立依赖关系:

  1. <!--依赖于pojo包,dao模块与pojo模块建立依赖联系-->
  2. <dependencies>
  3. <dependency>
  4. <groupId>top.jztice5</groupId>
  5. <artifactId>ssm-pojo</artifactId>
  6. <version>1.0-SNAPSHOT</version>
  7. </dependency>
  8. </dependencies>

2,实体类模块:

image.png


3,业务层(Service)模块:

image.png


4,表现层(Web)模块: 该模块是一个web项目模块

image.png

A,业务层模块必须与表现层模块建立依赖关系:

  1. <dependencies>
  2. <!-- 依赖service包:创建service模块与web模块的依赖关系 -->
  3. <dependency>
  4. <groupId>top.jztice5</groupId>
  5. <artifactId>ssm-service</artifactId>
  6. <version>1.0-SNAPSHOT</version>
  7. </dependency>
  8. </dependencies>

各相关模块之间记得绑定所需要的依赖关系;