Maven学习(九)- 构建SSH项目

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

1.新建一个Web项目

可以参照前面的博客

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

[html]  view plain copy
  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.   <!-- 属性配置 -->  
  12.   <properties>  
  13.       <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  
  14.   </properties>  
  15.     
  16.   <dependencies>  
  17.     <dependency>  
  18.       <groupId>junit</groupId>  
  19.       <artifactId>junit</artifactId>  
  20.       <version>4.10</version>  
  21.       <scope>test</scope>  
  22.     </dependency>  
  23.       
  24.     <!-- 添加SSH依赖 -->  
  25.     <!-- Struts2 -->  
  26.     <dependency>  
  27.         <groupId>org.apache.struts</groupId>  
  28.         <artifactId>struts2-core</artifactId>  
  29.         <version>2.3.1</version>  
  30.     </dependency>  
  31.       
  32.     <dependency>  
  33.         <groupId>org.apache.struts</groupId>  
  34.         <artifactId>struts2-spring-plugin</artifactId>  
  35.         <version>2.3.1</version>  
  36.     </dependency>  
  37.       
  38.      <!-- 添加Hibernate依赖 -->  
  39.     <dependency>  
  40.         <groupId>org.hibernate</groupId>  
  41.         <artifactId>hibernate-core</artifactId>  
  42.         <version>3.6.5.Final</version>  
  43.     </dependency>  
  44.       
  45.     <dependency>  
  46.         <groupId>commons-dbcp</groupId>  
  47.         <artifactId>commons-dbcp</artifactId>  
  48.         <version>1.4</version>  
  49.     </dependency>  
  50.       
  51.     <!-- 添加Log4J依赖 -->  
  52.     <dependency>  
  53.         <groupId>log4j</groupId>  
  54.         <artifactId>log4j</artifactId>  
  55.         <version>1.2.16</version>  
  56.     </dependency>  
  57.       
  58.     <dependency>  
  59.       <groupId>org.slf4j</groupId>  
  60.       <artifactId>slf4j-api</artifactId>  
  61.       <version>1.6.1</version>  
  62.     </dependency>  
  63.       
  64.     <dependency>  
  65.         <groupId>org.slf4j</groupId>  
  66.         <artifactId>slf4j-nop</artifactId>  
  67.         <version>1.6.4</version>  
  68.     </dependency>  
  69.       
  70.     <!-- 添加javassist -->  
  71.     <dependency>  
  72.         <groupId>javassist</groupId>  
  73.         <artifactId>javassist</artifactId>  
  74.         <version>3.11.0.GA</version>  
  75.     </dependency>  
  76.       
  77.     <!-- 添加Spring依赖 -->  
  78.     <dependency>  
  79.         <groupId>org.springframework</groupId>  
  80.         <artifactId>spring-core</artifactId>  
  81.         <version>3.1.1.RELEASE</version>  
  82.     </dependency>  
  83.       
  84.     <dependency>  
  85.         <groupId>org.springframework</groupId>  
  86.         <artifactId>spring-beans</artifactId>  
  87.         <version>3.1.1.RELEASE</version>  
  88.     </dependency>  
  89.       
  90.     <dependency>  
  91.         <groupId>org.springframework</groupId>  
  92.         <artifactId>spring-context</artifactId>  
  93.         <version>3.1.1.RELEASE</version>  
  94.     </dependency>  
  95.       
  96.     <dependency>  
  97.         <groupId>org.springframework</groupId>  
  98.         <artifactId>spring-jdbc</artifactId>  
  99.         <version>3.1.1.RELEASE</version>  
  100.     </dependency>  
  101.       
  102.     <dependency>  
  103.         <groupId>org.springframework</groupId>  
  104.         <artifactId>spring-orm</artifactId>  
  105.         <version>3.1.1.RELEASE</version>  
  106.     </dependency>  
  107.       
  108.     <dependency>  
  109.         <groupId>org.springframework</groupId>  
  110.         <artifactId>spring-web</artifactId>  
  111.         <version>3.1.1.RELEASE</version>  
  112.     </dependency>  
  113.       
  114.   </dependencies>  
  115.   <build>  
  116.     <finalName>test06</finalName>  
  117.   </build>  
  118. </project>  

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

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

相关的项目应该就到这里了,以后的话,会根据一些资料系统的学习一下maven,整理出更好的博客来大笑

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值