首选,这个项目是一个比较老的项目,使用的jdk版本是1.7,基础框架还是基础的spring和springmvc,然而持久层是Jpa,项目的pom.xml如下
<?xml version="1.0" encoding="UTF-8"?> <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> <parent> <groupId>com.oaoera</groupId> <artifactId>oaodz</artifactId> <version>1.0.0</version> <relativePath>../oao/pom.xml</relativePath> </parent> <name></name> <artifactId>oaodz_product</artifactId> <packaging>war</packaging> <!-- 项目属性 --> <properties> <package.environment>product</package.environment> <java.home>C:Program FilesJavajdk1.7.0_80</java.home> </properties> <!-- 依赖项定义 --> <dependencies> <dependency> <groupId>net.sf.ezmorph</groupId> <artifactId>ezmorph</artifactId> <version>1.0.6</version> </dependency> <dependency> <groupId>org.apache.zookeeper</groupId> <artifactId>zookeeper</artifactId> <version>3.4.6</version> </dependency> <!-- 分布式文件系统 mogilefs客户端 --> <dependency> <groupId>fm.last</groupId> <artifactId>moji</artifactId> <version>1.4.0</version> </dependency> <!--mvn install:install-file -DgroupId=org.apache.solr -DartifactId=solr-solrj -Dversion=4.10.4 -Dpackaging=jar -Dfile=d:solr-solrj-4.10.4.jar --> <dependency> <groupId>org.apache.solr</groupId> <artifactId>solr-solrj</artifactId> <version>4.10.4</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpmime</artifactId> <version>4.3.2</version> </dependency> <dependency> <groupId>org.noggit</groupId> <artifactId>noggit</artifactId> <version>0.5</version> </dependency> <!-- SPRING basic begin --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> </dependency> <!-- SPRING basic end --> <!-- AOP begin --> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> </dependency> <!-- AOP end --> <dependency> <groupId>com.danga</groupId> <artifactId>memcached</artifactId> <version>2.6.6</version> </dependency> <!-- PERSISTENCE begin --> <!-- hibernate --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-ehcache</artifactId> </dependency> <!-- mybatis --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> </dependency> <!-- spring data access --> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> </dependency> <!-- connection pool --> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat-jdbc</artifactId> </dependency> <!-- jdbc driver --> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc14</artifactId> <version>10.2.0.1.0</version> <scope>runtime</scope> </dependency> <!-- jdbc driver end --> <!-- WEB begin --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> </dependency> <dependency> <groupId>opensymphony</groupId> <artifactId>sitemesh</artifactId> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> </dependency> <!-- WEB end --> <dependency> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId> <version>3.1</version> </dependency> <!-- SECURITY begin --> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-spring</artifactId> </dependency> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-ehcache</artifactId> </dependency> <!-- SECURITY end --> <!-- SOAP begin --> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxws</artifactId> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http</artifactId> </dependency> <!-- SOAP end --> <!-- JAX-RS begin --> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxrs</artifactId> </dependency> <dependency> <groupId>com.fasterxml.jackson.jaxrs</groupId> <artifactId>jackson-jaxrs-json-provider</artifactId> </dependency> <!-- JAX-RS end --> <!-- JMS begin --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jms</artifactId> </dependency> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-core</artifactId> </dependency> <!-- JMS end --> <!-- TIMER --> <dependency> <groupId>org.quartz-scheduler</groupId> <artifactId>quartz</artifactId> </dependency> <!-- Redis --> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> </dependency> <!-- CACHE begin --> <dependency> <groupId>net.spy</groupId> <artifactId>spymemcached</artifactId> </dependency> <dependency> <groupId>com.thimbleware.jmemcached</groupId> <artifactId>jmemcached-core</artifactId> <!-- 为演示而改为runtime --> <scope>runtime</scope> </dependency> <dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache-core</artifactId> </dependency> <!-- CACHE end --> <!-- jolokia Restful JMX --> <dependency> <groupId>org.jolokia</groupId> <artifactId>jolokia-core</artifactId> </dependency> <!-- hystrix --> <dependency> <groupId>com.netflix.hystrix</groupId> <artifactId>hystrix-core</artifactId> </dependency> <!-- MONITOR begin --> <!-- javasimon --> <dependency> <groupId>org.javasimon</groupId> <artifactId>javasimon-spring</artifactId> </dependency> <dependency> <groupId>org.javasimon</groupId> <artifactId>javasimon-jdbc4</artifactId> </dependency> <dependency> <groupId>org.javasimon</groupId> <artifactId>javasimon-console-embed</artifactId> </dependency> <!-- MONITOR end --> <!-- JSR303 BeanValidator --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> </dependency> <!-- JSON --> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> </dependency> <dependency> <groupId>com.fasterxml.jackson.module</groupId> <artifactId>jackson-module-jaxb-annotations</artifactId> </dependency> <dependency> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-joda</artifactId> </dependency> <dependency> <groupId>com.jayway.jsonpath</groupId> <artifactId>json-path</artifactId> <version>0.8.1</version> </dependency> <dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <version>20140107</version> </dependency> <!-- XML begin --> <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> </dependency> <dependency> <groupId>jaxen</groupId> <artifactId>jaxen</artifactId> </dependency> <!-- XML end --> <!-- LOGGING begin --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jul-to-slf4j</artifactId> </dependency> <dependency> <groupId>com.googlecode.log4jdbc</groupId> <artifactId>log4jdbc</artifactId> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.16</version> </dependency> <!-- LOGGING end --> <!-- GENERAL UTILS begin --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> </dependency> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> </dependency> <dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> </dependency> <!-- GENERAL UTILS end --> <!-- OTHER TOOLS begin --> <dependency> <groupId>org.freemarker</groupId> <artifactId>freemarker</artifactId> </dependency> <dependency> <groupId>net.sf.dozer</groupId> <artifactId>dozer</artifactId> </dependency> <!-- email --> <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> </dependency> <dependency> <groupId>javax.activation</groupId> <artifactId>activation</artifactId> </dependency> <!-- OTHER TOOLS end --> <!-- TEST begin --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <!-- for xxxDemo class --> <scope>compile</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-module-junit4</artifactId> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-api-mockito</artifactId> </dependency> <dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-all</artifactId> <version>1.3</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <!-- for xxxDemo class --> <scope>compile</scope> </dependency> <!-- selenium 2.0 --> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-remote-driver</artifactId> </dependency> <!-- jetty for functional test and executable war --> <dependency> <groupId>org.eclipse.jetty.aggregate</groupId> <artifactId>jetty-webapp</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-jsp</artifactId> <scope>provided</scope> </dependency> <!-- h2 如果生产数据库不是H2,解开下面的注释 <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> </dependency> --> <!-- mail server simulator --> <dependency> <groupId>com.icegreen</groupId> <artifactId>greenmail</artifactId> </dependency> <!-- excel jar --> <dependency> <groupId>jexcelapi</groupId> <artifactId>jxl</artifactId> <version>2.4.2</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.9</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.9</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml-schemas</artifactId> <version>3.9</version> </dependency> <dependency> <groupId>com.thoughtworks.xstream</groupId> <artifactId>xstream</artifactId> <version>1.4.2</version> </dependency> <!--end excel jar --> <!-- 上传附件 --> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.3</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> </dependency> <!-- 路径重写 --> <dependency> <groupId>org.tuckey</groupId> <artifactId>urlrewritefilter</artifactId> <version>4.0.4</version> <type>jar</type> <scope>compile</scope> </dependency> <!-- JPA自定义工厂使用 --> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.4</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.3.1</version> </dependency> <dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.4</version> <classifier>jdk15</classifier> </dependency> <dependency> <groupId>com.google.zxing</groupId> <artifactId>erweima</artifactId> <version>1.0.0</version> </dependency> <!--二维码生成--> <dependency> <groupId>com.google.zxing</groupId> <artifactId>core</artifactId> <version>3.1.0</version> </dependency> <dependency> <groupId>com.google.zxing</groupId> <artifactId>javase</artifactId> <version>3.1.0</version> </dependency> <dependency> <groupId>com.capinfo</groupId> <artifactId>crypt</artifactId> <version>1.0.0</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>com.capinfo</groupId> <artifactId>md5</artifactId> <version>1.0.0</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.7.3</version> </dependency> <dependency> <groupId>javapns</groupId> <artifactId>javapns</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>com.alipay.api</groupId> <artifactId>alipayapi</artifactId> <version>1.0</version> </dependency> </dependencies> <build> <plugins> <!-- 指定jdk版本 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> <encoding>UTF-8</encoding> <!-- 解决程序包com.sun.image.codec.jpeg不存在 问题 --> <compilerArguments> <verbose /> <bootclasspath>${java.home}jrelib t.jar;${java.home}jrelibjce.jar</bootclasspath> </compilerArguments> </configuration> </plugin> <!-- war包插件,命令:mvn package -Pdevelop -DskipTests --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <archive> <addMavenDescriptor>false</addMavenDescriptor> </archive> <includeEmptyDirectories>true</includeEmptyDirectories> <warName>${project.artifactId}</warName> <webResources> <resource> <directory>env/${package.environment}</directory> <targetPath>WEB-INF/classes</targetPath> <filtering>true</filtering> </resource> <resource> <directory>src/main/resources</directory> <targetPath>WEB-INF/classes</targetPath> </resource> </webResources> </configuration> </plugin> <!-- tomcat7插件,命令: mvn tomcat7:run -DskipTests --> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.0-beta-1</version> <configuration> <uriEncoding>utf-8</uriEncoding> <port>80</port> <path>/product</path> </configuration> </plugin> </plugins> </build> </project>