工程模塊和模塊劃分
將ssm這個(gè)項(xiàng)目分模塊(前面三個(gè)南顾牵快的創(chuàng)建不需要用到模板,直接創(chuàng)建空的maven)
把上面的劃分成下面的模塊
首先ssm_dao分離
點(diǎn)擊如下:
創(chuàng)建一個(gè)新模塊:
其他步驟就是創(chuàng)建maven項(xiàng)目
下面是創(chuàng)建好的項(xiàng)目棍好,只需要將domain的類導(dǎo)入,其他都不需要,沒(méi)有配置
compile編譯一下看是否成功
ssm_dao的分離
創(chuàng)建一個(gè)新的模塊
然后把文件導(dǎo)入進(jìn)去
pom文件
<dependencies>
<dependency>
<groupId>com.itheima</groupId>
<artifactId>ssm_pojo</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!--spring環(huán)境-->
<!--spring環(huán)境-->
<!--spring環(huán)境-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.1.9.RELEASE</version>
</dependency>
<!--mybatis環(huán)境-->
<!--mybatis環(huán)境-->
<!--mybatis環(huán)境-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.3</version>
</dependency>
<!--mysql環(huán)境-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.47</version>
</dependency>
<!--spring整合jdbc-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>5.1.9.RELEASE</version>
</dependency>
<!--spring整合mybatis-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>2.0.3</version>
</dependency>
<!--druid連接池-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.16</version>
</dependency>
<!--分頁(yè)插件坐標(biāo)-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.2</version>
</dependency>
</dependencies>
ssm_service的分離
pom文件
<dependencies>
<!--spring環(huán)境-->
<!--spring環(huán)境-->
<!--spring環(huán)境-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.1.9.RELEASE</version>
</dependency>
<dependency>
<groupId>com.itheima</groupId>
<artifactId>ssm_dao</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!--junit單元測(cè)試-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<!--spring整合junit-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.1.9.RELEASE</version>
</dependency>
</dependencies>
ssm_controller的分離(這個(gè)模塊的創(chuàng)建需要用到模板)
pom文件
<dependencies>
<dependency>
<groupId>com.itheima</groupId>
<artifactId>ssm_service</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!--springmvc環(huán)境-->
<!--springmvc環(huán)境-->
<!--springmvc環(huán)境-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.1.9.RELEASE</version>
</dependency>
<!--jackson相關(guān)坐標(biāo)3個(gè)-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>