Maven的学习资料收集--(九) 构建SSH项目以及专栏maven


目录(?[+]

在这里整合一下,使用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构建SSH项目源码:http://download.csdn.net/detail/jolingogo/5274494

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

你可能感兴趣的:(Maven的学习资料收集--(九) 构建SSH项目以及专栏maven)