maven多模块ssmfreemarker搭建总结.docx
- 文档编号:24249150
- 上传时间:2023-05-25
- 格式:DOCX
- 页数:44
- 大小:1.03MB
maven多模块ssmfreemarker搭建总结.docx
《maven多模块ssmfreemarker搭建总结.docx》由会员分享,可在线阅读,更多相关《maven多模块ssmfreemarker搭建总结.docx(44页珍藏版)》请在冰豆网上搜索。
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=""> 接下来创建的都是该项目的模块: 我理解的模块是分级的.在本项目中分为两级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=""> Handsome-bizpom.xml xmlversion="1.0"encoding="UTF-8"? > xsi=""xsi: schemaLocation=""> Handsome-biz-daopom.xml xmlversion="1.0"? > schemaLocation=""xmlns="" xmlns: xsi=""> --junit测试包--> --mybatis驱动包--> --mysql驱动包--> --dbcp数据源--> handsome-biz-managerpom.xml xmlversion="1.0"? > schemaLocation=""xmlns="" xmlns: xsi=""> --junit测试包--> --mybatis驱动包--> --mysql驱动包--> --dbcp数据源--> handsome-webpom.xml xmlversion="1.0"? > schemaLocation=""xmlns="" xmlns: xsi=""> --junit测试包--> --mybatis驱动包--> --mysql驱动包--> --dbcp数据源--> Handsome-web-corepom.xml xmlversion="1.0"? > schemaLocation=""xmlns="" xmlns: xsi=""> --freemarker依赖--> handsome-web-deploypom.xml xmlversion="1.0"? > schemaLocation=""xmlns="" xmlns: xsi=""> handsome-web-warpom.xml xmlversion="1.0"? > schemaLocation=""xmlns="" xmlns: xsi=""> 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"> spring/spring-mvc.xml 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
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- maven 模块 ssmfreemarker 搭建 总结
![提示](https://static.bdocx.com/images/bang_tan.gif)