在这里整合一下,使用Maven构建一个SSH项目
1.新建一个Web项目
可以参照前面的博客
2.添加依赖,修改pom.xml
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>com.deppon.demo</groupId>
- <artifactId>test06</artifactId>
- <packaging>war</packaging>
- <version>0.0.1-SNAPSHOT</version>
- <name>test06 Maven Webapp</name>
- <url>http://maven.apache.org</url>
- <!-- 属性配置 -->
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.10</version>
- <scope>test</scope>
- </dependency>
- <!-- 添加SSH依赖 -->
- <!-- Struts2 -->
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-core</artifactId>
- <version>2.3.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-spring-plugin</artifactId>
- <version>2.3.1</version>
- </dependency>
- <!-- 添加Hibernate依赖 -->
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>3.6.5.Final</version>
- </dependency>
- <dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
- </dependency>
- <!-- 添加Log4J依赖 -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.16</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.6.1</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-nop</artifactId>
- <version>1.6.4</version>
- </dependency>
- <!-- 添加javassist -->
- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>3.11.0.GA</version>
- </dependency>
- <!-- 添加Spring依赖 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>3.1.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <version>3.1.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>3.1.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- <version>3.1.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- <version>3.1.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>3.1.1.RELEASE</version>
- </dependency>
- </dependencies>
- <build>
- <finalName>test06</finalName>
- </build>
- </project>
3.各种配置文件,各种代码
这里的话,就不贴代码了,和使用MyEclipse开发Web项目是一样的,在后一篇博客中也提到了,其实,之前的好多博客都是一样的原理,都是修改依赖配置,其他没什么,
相关的项目应该就到这里了,以后的话,会根据一些资料系统的学习一下maven,整理出更好的博客来。
使用Maven构建SSH项目源码:http://download.csdn.net/detail/jolingogo/5274494
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------