Maven搭建SSH的pom的代码详解(转载)
2017-07-18 13:07
405 查看
前言
因项目需要第一次是用Maven搭建项目,在网上找了许久pom配置总是会出现一些包不兼容等小问题,经过多次改动版本测试,以下pom勉强能使用,但是hibernate配置实体类仍有问题。但因项目进度问题所以没有再进行测试修改了
参考资料
MyEclipse10.7使用Maven搭建Struts2+Spring3+Hibernate4的整合开发环境maven in action(十)maven项目建立和运行过程中可能的错误
http://www.mvnrepository.com/
Maven配置文件pom.xml详解-Chil1ax
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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.donghaiair.AMS_V1</groupId> <artifactId>AMS_V1</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name>AMS_V1</name> <description/> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <!-- junit --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> <!-- spring --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>3.1.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>3.1.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>3.1.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>3.1.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>3.1.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>3.1.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>3.1.2.RELEASE</version> </dependency> <!-- hibernate --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>4.1.7.Final</version> </dependency> <!-- struts2 --> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-core</artifactId> <version>2.3.16</version> <!-- 这里的 exclusions 是排除包,因为 Struts2中有javassist,Hibernate中也有javassist, 所以如果要整合Hibernate,一定要排除掉Struts2中的javassist,否则就冲突了。--> <exclusions> <exclusion> <groupId>javassist</groupId> <artifactId>javassist</artifactId> </exclusion> </exclusions> </dependency> <!-- 使用了这个插件之后,就可以采用注解的方式配置Struts的Action,免去了在struts.xml中的繁琐配置项 --> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-convention-plugin</artifactId> <version>2.3.20</version> </dependency> <!--config-browser-plugin插件,使用了这个插件之后,就可以很方便的浏览项目中的所有action及其与 jsp view的映射 --> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-config-browser-plugin</artifactId> <version>2.3.20</version> </dependency> <!-- Struts2和Spring整合插件 --> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-spring-plugin</artifactId> <version>2.3.4.1</version> </dependency> <!-- struts2-json-plugin --> <!-- <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-json-plugin</artifactId> <version>2.5</version> </dependency> --> <!-- http://mvnrepository.com/artifact/org.apache.struts/struts2-json-plugin --> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-json-plugin</artifactId> <version>2.3.8</version> </dependency> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc14</artifactId> <version>10.2.0.3.0</version> </dependency> <!--Druid连接池包 --> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.0.12</version> </dependency> <!--aspectjweaver包 --> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.8.5</version> </dependency> <!-- <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-core</artifactId> <version>2.3.20</version> <exclusions> <exclusion> Hibernate已经还有该包的依赖 <artifactId>javassist</artifactId> <groupId>javassist</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-spring-plugin</artifactId> <version>2.3.20</version> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-convention-plugin</artifactId> <version>2.3.20</version> </dependency> --> <!-- log4j --> <!-- <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> --> <!-- ojdbc --> <!-- <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc14</artifactId> <version>10.2.0.3.0</version> </dependency> --> <!-- mysql --> <!-- <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.37</version> </dependency> --> <!-- druid数据源 --> <!-- <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.0.16</version> </dependency> --> <!-- json工具 --> <!-- <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.7</version> </dependency> --> <!-- jackson也是json工具 --> <!-- <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>2.6.0</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.6.0</version> </dependency> --> <!-- <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.6.0</version> </dependency> --> <!-- aop --> <!-- <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.8.9</version> </dependency> --> <!-- servlet --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.0.1</version> <!-- 只在编译时和测试时运行 --> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> <!-- http://mvnrepository.com/artifact/com.google.code.gson/gson --> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.6.2</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml --> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.14</version> </dependency> </dependencies> <build> <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> <version>3.1</version> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> --> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <executions> <execution> <!-- 在打包成功后使用tomcat:run来运行服务 --> <phase>package</phase> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.4.2</version> <configuration> <skipTests>true</skipTests> </configuration> </plugin> </plugins> </build> </project>
相关文章推荐
- Maven搭建SSH的pom的代码详解
- 转载 : 史上最全的maven pom.xml文件教程详解
- Maven的pom.xml文件详解【转载】
- 【转载】Maven pom.xml 配置参数详解
- ssh+maven+annotation+shiro搭建运行用户登录权限验证代码demo下载
- Maven搭建ssh环境(myeclipse2014) - pom.xml中dependencies+plugins
- Maven 搭建ssh项目 pom.xml
- 【转载】史上最全的maven pom.xml文件教程详解
- maven pom.xml文件详解
- 史上最全的maven pom.xml文件教程详解
- Maven系列一pom.xml 配置详解
- Maven的pom.xml配置文件详解
- maven pom.xml详解
- maven项目的pom.xml文件详解
- Maven核心之pom详解
- Maven系列--pom.xml 配置详解
- 史上最全的maven的pom.xml文件详解
- Maven pom.xml 配置详解
- Maven的POM文件详解
- maven pom.xml 标签详解