maven多模块ssmfreemarker搭建总结.docx

上传人:b****3 文档编号:10400794 上传时间:2023-05-25 格式:DOCX 页数:44 大小:1.03MB
下载 相关 举报
maven多模块ssmfreemarker搭建总结.docx_第1页
第1页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第2页
第2页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第3页
第3页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第4页
第4页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第5页
第5页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第6页
第6页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第7页
第7页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第8页
第8页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第9页
第9页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第10页
第10页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第11页
第11页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第12页
第12页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第13页
第13页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第14页
第14页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第15页
第15页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第16页
第16页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第17页
第17页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第18页
第18页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第19页
第19页 / 共44页
maven多模块ssmfreemarker搭建总结.docx_第20页
第20页 / 共44页
亲,该文档总共44页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

maven多模块ssmfreemarker搭建总结.docx

《maven多模块ssmfreemarker搭建总结.docx》由会员分享,可在线阅读,更多相关《maven多模块ssmfreemarker搭建总结.docx(44页珍藏版)》请在冰点文库上搜索。

maven多模块ssmfreemarker搭建总结.docx

maven多模块ssmfreemarker搭建总结

Ssm+maven+freemarker搭建

1.用maven创建多模块项目

1.整个项目的结构

|--handsome

|--handsome-biz

|--handsome-biz-dao数据库层

|--handsome-biz-manager业务层

|--handsome-web

|--handsome-web-deploy页面模板

|--handsome-web-home控制层

|--handsome-web-war用来运行,打包

2.首先创建一个maven项目

修改pom.xml文件

xsi=""

xsi:

schemaLocation="">

4.0.0

com.handsome

handsome

0.0.1-SNAPSHOT

pom

handsome

UTF-8

junit

junit

3.8.1

test

接下来创建的都是该项目的模块:

我理解的模块是分级的.在本项目中分为两级handsome-biz和handsome-web是一级.其他为二级模块

3.创建一级模块handsome-biz和handsome-web

在handsome项目上新建模块

完成后在handsome中pom.xml文件中可以看到,两个子模块

修改两个一级模块的pom.xml文件的package为pom准备创建二级模块

将红框中不需要的删除,新增packaing标签

4.创建二级模块

在handsome-biz和handsome-web下创建二级模块

创建方法和上面一样.不在复述..

5.删除一些不要的目录和依赖

父项目不要依赖.吧dependencies标签干掉左侧mavendependencies目录就没有了.

Handsome删成这样

其他两个一级模块也删到这样简洁.

6.添加模块之间的依赖关系

在handsome-biz-manager中添加对handsome-biz-dao的依赖

在handsome-web-core中添加对handsome-biz-manager的依赖

在handsome-web-war中添加对handsome-web-core的依赖

最终项目就变成了这样:

2.ssm整合

1.将war项目转换成web项目

这样项目就可以添加到tomcat了

部署的少了依赖包

2.增加maven依赖到部署

3.修改整理pom文件

Handsomepom.xml

xmlversion="1.0"encoding="UTF-8"?

>

xsi=""xsi:

schemaLocation="">

UTF-8

4.0.6.RELEASE

3.2.7

5.1.29

2.3.20

4.0.0

com.handsome

handsome

0.1

pom

handsome

handsome-biz

handsome-web

Handsome-bizpom.xml

xmlversion="1.0"encoding="UTF-8"?

>

xsi=""xsi:

schemaLocation="">

UTF-8

4.0.6.RELEASE

3.2.7

5.1.29

2.3.20

4.0.0

com.handsome

handsome

0.1

pom

handsome

handsome-biz

handsome-web

Handsome-biz-daopom.xml

xmlversion="1.0"?

>

schemaLocation=""xmlns=""

xmlns:

xsi="">

4.0.0

com.handsome

handsome-biz

0.1

handsome-biz-dao

handsome-biz-dao

--junit测试包-->

junit

junit

4.11

test

--mybatis驱动包-->

org.mybatis

mybatis

${mybatis.version}

org.mybatis

mybatis-spring

1.2.2

--mysql驱动包-->

mysql

mysql-connector-java

${mysql.version}

--dbcp数据源-->

commons-dbcp

commons-dbcp

1.4

commons-pool

commons-pool

1.6

handsome-biz-managerpom.xml

xmlversion="1.0"?

>

schemaLocation=""xmlns=""

xmlns:

xsi="">

4.0.0

com.handsome

handsome-biz

0.1

handsome-biz-dao

handsome-biz-dao

--junit测试包-->

junit

junit

4.11

test

--mybatis驱动包-->

org.mybatis

mybatis

${mybatis.version}

org.mybatis

mybatis-spring

1.2.2

--mysql驱动包-->

mysql

mysql-connector-java

${mysql.version}

--dbcp数据源-->

commons-dbcp

commons-dbcp

1.4

commons-pool

commons-pool

1.6

handsome-webpom.xml

xmlversion="1.0"?

>

schemaLocation=""xmlns=""

xmlns:

xsi="">

4.0.0

com.handsome

handsome-biz

0.1

handsome-biz-dao

handsome-biz-dao

--junit测试包-->

junit

junit

4.11

test

--mybatis驱动包-->

org.mybatis

mybatis

${mybatis.version}

org.mybatis

mybatis-spring

1.2.2

--mysql驱动包-->

mysql

mysql-connector-java

${mysql.version}

--dbcp数据源-->

commons-dbcp

commons-dbcp

1.4

commons-pool

commons-pool

1.6

Handsome-web-corepom.xml

xmlversion="1.0"?

>

schemaLocation=""xmlns=""

xmlns:

xsi="">

4.0.0

com.handsome

handsome-web

0.1

handsome-web-core

handsome-web-core

com.handsome

handsome-biz-manager

${project.version}

--freemarker依赖-->

org.freemarker

freemarker

${freemarker.version}

handsome-web-deploypom.xml

xmlversion="1.0"?

>

schemaLocation=""xmlns=""

xmlns:

xsi="">

4.0.0

com.handsome

handsome-web

0.1

handsome-web-deploy

handsome-web-deploy

pom

handsome-web-warpom.xml

xmlversion="1.0"?

>

schemaLocation=""xmlns=""

xmlns:

xsi="">

4.0.0

com.handsome

handsome-web

0.1

handsome-web-war

handsome-web-war

war

com.handsome

handsome-web-core

${project.version}

4.编译项目

上选择maveninstall

如果有错,,整项目部署目录和web.xml文件

完成后可以看到tomcat中的变化

依赖包出现了.

5.整合思路

6.写一个简单功能代码

写一个简单功能代码.从dao到manager(service)到controller

Dao层新建userdao,userdo

Manager层

Controller层也就是handsome-web-core模块

Handsome-web-deploy

上面详细的列出了项目结构和具体代码

7.具体配置

Web.xml

xmlversion="1.0"encoding="UTF-8"?

>

xmlns:

xsi=""

xsi:

schemaLocation="

"version="3.0">

springmvc

org.springframework.web.servlet.DispatcherServlet

contextConfigLocation

classpath:

spring/spring-mvc.xml

1

springmvc

/

Handsome-web-war中Config.properties

##############freemarker的配置###################

handsome.freemarker.templates=E:

/eclipse_workspace/ssm_workspace/handsome/handsome-web/handsome-web-deploy/templates

##############log4j的配置###################

handsome.loggingRoot=/tmp/Logs/handsome

handsome.loggingLevel=info

Springmvc.xml

xmlversion="1.0"encoding="UTF-8"?

>

xmlns:

xsi=""

xmlns:

context=""

xmlns:

mvc=""

xmlns:

aop=""

xmlns:

tx=""

xmlns:

p=""

xsi:

schemaLoca

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 解决方案 > 学习计划

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2