在这里整合一下,使用Maven构建一个SSH项目

1.新建一个Web项目

可以参照前面的博客

2.添加依赖,修改pom.xml

  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <groupId>com.deppon.demo</groupId>
  5. <artifactId>test06</artifactId>
  6. <packaging>war</packaging>
  7. <version>0.0.1-SNAPSHOT</version>
  8. <name>test06 Maven Webapp</name>
  9. <url>http://maven.apache.org</url>
  10. <!-- 属性配置 -->
  11. <properties>
  12. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  13. </properties>
  14. <dependencies>
  15. <dependency>
  16. <groupId>junit</groupId>
  17. <artifactId>junit</artifactId>
  18. <version>4.10</version>
  19. <scope>test</scope>
  20. </dependency>
  21. <!-- 添加SSH依赖 -->
  22. <!-- Struts2 -->
  23. <dependency>
  24. <groupId>org.apache.struts</groupId>
  25. <artifactId>struts2-core</artifactId>
  26. <version>2.3.1</version>
  27. </dependency>
  28. <dependency>
  29. <groupId>org.apache.struts</groupId>
  30. <artifactId>struts2-spring-plugin</artifactId>
  31. <version>2.3.1</version>
  32. </dependency>
  33. <!-- 添加Hibernate依赖 -->
  34. <dependency>
  35. <groupId>org.hibernate</groupId>
  36. <artifactId>hibernate-core</artifactId>
  37. <version>3.6.5.Final</version>
  38. </dependency>
  39. <dependency>
  40. <groupId>commons-dbcp</groupId>
  41. <artifactId>commons-dbcp</artifactId>
  42. <version>1.4</version>
  43. </dependency>
  44. <!-- 添加Log4J依赖 -->
  45. <dependency>
  46. <groupId>log4j</groupId>
  47. <artifactId>log4j</artifactId>
  48. <version>1.2.16</version>
  49. </dependency>
  50. <dependency>
  51. <groupId>org.slf4j</groupId>
  52. <artifactId>slf4j-api</artifactId>
  53. <version>1.6.1</version>
  54. </dependency>
  55. <dependency>
  56. <groupId>org.slf4j</groupId>
  57. <artifactId>slf4j-nop</artifactId>
  58. <version>1.6.4</version>
  59. </dependency>
  60. <!-- 添加javassist -->
  61. <dependency>
  62. <groupId>javassist</groupId>
  63. <artifactId>javassist</artifactId>
  64. <version>3.11.0.GA</version>
  65. </dependency>
  66. <!-- 添加Spring依赖 -->
  67. <dependency>
  68. <groupId>org.springframework</groupId>
  69. <artifactId>spring-core</artifactId>
  70. <version>3.1.1.RELEASE</version>
  71. </dependency>
  72. <dependency>
  73. <groupId>org.springframework</groupId>
  74. <artifactId>spring-beans</artifactId>
  75. <version>3.1.1.RELEASE</version>
  76. </dependency>
  77. <dependency>
  78. <groupId>org.springframework</groupId>
  79. <artifactId>spring-context</artifactId>
  80. <version>3.1.1.RELEASE</version>
  81. </dependency>
  82. <dependency>
  83. <groupId>org.springframework</groupId>
  84. <artifactId>spring-jdbc</artifactId>
  85. <version>3.1.1.RELEASE</version>
  86. </dependency>
  87. <dependency>
  88. <groupId>org.springframework</groupId>
  89. <artifactId>spring-orm</artifactId>
  90. <version>3.1.1.RELEASE</version>
  91. </dependency>
  92. <dependency>
  93. <groupId>org.springframework</groupId>
  94. <artifactId>spring-web</artifactId>
  95. <version>3.1.1.RELEASE</version>
  96. </dependency>
  97. </dependencies>
  98. <build>
  99. <finalName>test06</finalName>
  100. </build>
  101. </project>

3.各种配置文件,各种代码

这里的话,就不贴代码了,和使用MyEclipse开发Web项目是一样的,在后一篇博客中也提到了,其实,之前的好多博客都是一样的原理,都是修改依赖配置,其他没什么,

使用Maven构建SSH项目源码:http://download.csdn.net/detail/jolingogo/5274494

maven资料学习专栏:http://blog.csdn.net/column/details/yuguiyang-maven.html

Maven的学习资料收集--(九) 构建SSH项目以及专栏maven的更多相关文章

  1. Maven的学习资料收集--(八) 构建MyBatis项目

    在这里,写一下,怎么使用Maven构建MyBatis项目. 1. 新建一个Web项目 可以参考前面的博客 2. 修改pom.xml,添加MyBatis依赖 <project xmlns=&quo ...

  2. Maven的学习资料收集--(七) 构建Spring项目

    在这里,使用Maven构建一个Spring项目 构建单独项目的话,其实都差不多 1. 新建一个Web项目 参考之前的博客 2.修改 pom.xml,添加Spring依赖 <project xml ...

  3. Maven的学习资料收集--(十)Myeclipse下创建Maven的Web项目

    先要在MyEclipse中对Maven进行设置: 到此Maven对MyEclipse的支持设置完毕.   下面我们在MyEclipse中创建一个Maven标准的Web工程: New --> We ...

  4. Maven的学习资料收集--(五)使用Maven构建Struts2项目

    在前两篇博客中,使用Maven构建了Web项目,在这篇博客中写一下,怎样构建一个简单的Struts2项目. 在准备过程中发现,要使用好Maven,个人觉得要好好利用这两个网站: http://mvnr ...

  5. Maven的学习资料收集--(三)使用Maven构建Web项目

    新建Maven项目 File - New - Other 选择Maven Project 单击Next 保持默认即可单击Next 选择Archetype为 web app单击Next 输入一些必要信息 ...

  6. Maven的学习资料收集--(六) 构建Hibernate项目

    前面我们使用Maven构建了Struts2项目,这里我们来试一下Hibernate项目: 这里的例子,大体框架应该是正确的,但是,对于Maven的很多约定都没有掌握,估计包的命名都不是非常好,等以后, ...

  7. Maven的学习资料收集--(四)使用Maven构建Web项目-测试

    2014-08-04 23:21 2人阅读 评论(0) 收藏 编辑 删除   目录(?)[+]   [-] 在srcmainjava下新建一个Servlet 修改webxml 新建JSP 测试   在 ...

  8. Maven的学习资料收集--(一)环境搭建

    这几天在做项目的时候用到了maven,但是自己没有从来没有接触过,所以咋网上找资料,终于找到了一下的资料,这个是别人总结的,我只是转载过来积累.请尊重原创. 官网地址:http://maven.apa ...

  9. Maven的学习资料收集--(二)安装m2eclipse插件

    在Eclipse中可以安装Maven插件,可以更方便的使用: 官网地址:http://www.eclipse.org/m2e/ 可以在线安装或者离线下载,之前在线安装总是失败,可能是网速的原因,找到了 ...

随机推荐

  1. 二叉搜索树的结构(30 分) PTA 模拟+字符串处理 二叉搜索树的节点插入和非递归遍历

    二叉搜索树的结构(30 分) 二叉搜索树或者是一棵空树,或者是具有下列性质的二叉树: 若它的左子树不空,则左子树上所有结点的值均小于它的根结点的值:若它的右子树不空,则右子树上所有结点的值均大于它的根 ...

  2. 初识Luajit

    转自:http://www.cppblog.com/pwq1989/archive/2013/11/28/204487.html 大家可以从官网下载到源码(http://luajit.org/),也可 ...

  3. oracle--pl/sql变量定义----

    一.变量介绍 在编写pl/sql程序时,可以定义变量和常量:在pl/sql程序中包括有: 1).标量类型(scalar) 2).复合类型(composite) --用于操作单条记录 3).参照类型(r ...

  4. python 基础 字典 增删改查

    content = {"name":"wd","pc":{"phone":111111,"age": ...

  5. python 基础 列表 小例子

    存主机ip到列表 host_list=[] netip='192.168.1' for hostip in range(1,254): ip = netip +str(hostip) host_lis ...

  6. shell入门-awk-2

    awk的条件操作符 ///显示第一段有root的行 [root@wangshaojun ~]# awk -F ':' '$1=="root"' 1.txtroot:x:0:0:ro ...

  7. shell入门-awk-1

    awk对于sed grep的优势在于分段,把分隔符分割成一小段一小段,针对段进行匹配,替换,操作,逻辑判断,比较...等 awk的基本操作 [root@wangshaojun ~]# awk -F ' ...

  8. MySQL绿色版的安装步骤

    由于工作需要最近要开始研究MySQL了(看来学习都是逼出来的),本人对mysql没有研究,可以说一个小白. 下面就从安装开始吧,虽然网上关于这方面的东西很多,还是需要自己把操作过程写下来. 1.数据库 ...

  9. JAVA类,变量的赋值一个小细节,以及static标注变量的意义

    在JAVA类中方法外部定义的变量,如果定义的时候没有赋值,那么在方法外也不能对其进行赋值,否则报错,只能放入某一个方法内对其赋值.(为何报错待晚些时候深入查找补充) static标注的变量称为静态变量 ...

  10. Java异常处理的10个最佳实践

    本文作者: ImportNew - 挖坑的张师傅 未经许可,禁止转载! 异常处理在编写健壮的 Java 应用中扮演着非常重要的角色.异常处理并不是功能性需求,它需要优雅地处理任何错误情况,比如资源不可 ...