Maven 创建SSH框架的POM文件整理

<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>test</groupId>
	<artifactId>Blog</artifactId>
	<packaging>war</packaging>
	<version>0.0.1-SNAPSHOT</version>
	<name>Blg Maven Webapp</name>
	<url>http://maven.apache.org</url>

	<properties>
		<javax.servlet-api.version>3.0.1</javax.servlet-api.version>
		<spring.version>4.2.5.RELEASE</spring.version>
		<struts2-core.version>2.3.24.1</struts2-core.version>
		<!-- 配置 5.+版本时,出现无法创建sessionFactory 的错误,以后若需要再研究 -->
		<hibernate.version>4.3.11.Final</hibernate.version>
		<spring-boot.version>1.3.3.RELEASE</spring-boot.version>
		<mysql.version>5.1.38</mysql.version>
		<log4j.version>1.2.17</log4j.version>
	</properties>

	<dependencies>
		<!-- spring -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring.version}</version>
		</dependency>
		
		<!-- 不添加会报错,具体原理没有明白 -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aspects</artifactId>
			<version>${spring.version}</version>
		</dependency>
		
		<!-- orm 映射,支持hibernate iBatis等数据库 -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-orm</artifactId>
			<version>${spring.version}</version>
		</dependency>

		<!-- Struts2 -->
		<dependency>
			<groupId>org.apache.struts</groupId>
			<artifactId>struts2-core</artifactId>
			<version>${struts2-core.version}</version>
			<exclusions>
				<exclusion>
					<artifactId>javassist</artifactId>
					<groupId>javassist</groupId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- Hibernate -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-entitymanager</artifactId>
			<version>${hibernate.version}</version>
		</dependency>
		
		<!-- struts2 spring 整合 -->
		<dependency>
			<groupId>org.apache.struts</groupId>
			<artifactId>struts2-spring-plugin</artifactId>
			<version>${struts2-core.version}</version>
		</dependency>
		
		<!-- jstl -->
		<dependency>
			<groupId>org.glassfish.web</groupId>
			<artifactId>javax.servlet.jsp.jstl</artifactId>
			<version>1.2.2</version>
		</dependency>

		<!-- MySQL -->
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>${mysql.version}</version>
		</dependency>

		<!-- Log4j -->
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>${log4j.version}</version>
		</dependency>

		<!-- test相关依赖 -->
		<!-- junit -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>

		<!-- test for struts2 -->
		<dependency>
			<groupId>org.apache.struts</groupId>
			<artifactId>struts2-junit-plugin</artifactId>
			<version>${struts2-core.version}</version>
			<scope>test</scope>
		</dependency>

	</dependencies>
	
	<!-- MyEclipse 在新建maven项目时自动生成 -->
	<build>
		<sourceDirectory>src</sourceDirectory>
		<resources>
			<resource>
				<directory>src</directory>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.2</version>
				<configuration>
					<warSourceDirectory>${basedir}/WebRoot</warSourceDirectory>
					<version>3.1</version>
					<failOnMissingWebXml>false</failOnMissingWebXml>
				</configuration>
			</plugin>

		</plugins>
	</build>
</project>


你可能感兴趣的:(maven,MyEclipse,pom.xml,ssh)