在pom.xml加入:
- <build>
- <finalName>oauth2</finalName>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.properties</include>
- <include>**/*.jsp</include>
- </includes>
- <filtering>true</filtering>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-maven-plugin</artifactId>
- <version>8.1.14.v20131031</version>
- <configuration>
- <scanIntervalSeconds>30</scanIntervalSeconds>
- <webApp>
- <contextPath>/</contextPath>
- </webApp>
- </configuration>
- </plugin>
- </plugins>
- </build>
或者加入:
- <build>
- <finalName>oauth2</finalName>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.properties</include>
- <include>**/*.jsp</include>
- </includes>
- <filtering>true</filtering>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.5.1</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.12</version>
- <configuration>
- <includes>
- <include>**/*Test.java</include>
- </includes>
- <excludes>
- <exclude>**/Abstract*.java</exclude>
- <exclude>**/*Main.java</exclude>
- </excludes>
- <junitArtifactName>junit:junit</junitArtifactName>
- <argLine>-Xmx512m</argLine>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.mybatis.generator</groupId>
- <artifactId>mybatis-generator-maven-plugin</artifactId>
- <version>${mybatis.generator.version}</version>
- </plugin>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-maven-plugin</artifactId>
- <version>8.1.14.v20131031</version>
- <configuration>
- <scanIntervalSeconds>30</scanIntervalSeconds>
- <webApp>
- <contextPath>/</contextPath>
- </webApp>
- </configuration>
- </plugin>
- </plugins>
- </build>
整个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.xuan</groupId>
- <artifactId>oauth2</artifactId>
- <packaging>war</packaging>
- <version>0.0.1-SNAPSHOT</version>
- <name>maven</name>
- <url>http://maven.apache.org</url>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <junit.version>4.8.2</junit.version>
- <servlet.version>2.5</servlet.version>
- <jsp.version>2.1</jsp.version>
- <slf4j.version>1.6.6</slf4j.version>
- <log4j.version>1.2.14</log4j.version>
- <commons.lang3.version>3.1</commons.lang3.version>
- <commons.codec.version>1.8</commons.codec.version>
- <httpcomponents.version>4.2.5</httpcomponents.version>
- <commons.fileupload.version>1.2.2</commons.fileupload.version>
- <commons.io.version>2.4</commons.io.version>
- <commons.email.version>1.2</commons.email.version>
- <commons.validator.version>1.4.0</commons.validator.version>
- <commons.exec.version>1.2</commons.exec.version>
- <mysql.connector.java.version>5.1.25</mysql.connector.java.version>
- <tomcat.jdbc.version>7.0.39</tomcat.jdbc.version>
- <spring.version>3.1.2.RELEASE</spring.version>
- <mybatis.version>3.2.5</mybatis.version>
- <mybatis.spring.version>1.2.2</mybatis.spring.version>
- <mybatis.generator.version>1.3.2</mybatis.generator.version>
- <freemarker.version>2.3.19</freemarker.version>
- <jackson.version>2.0.1</jackson.version>
- <spymemcached.version>2.10.6</spymemcached.version>
- <!-- Used by MyBatis Generator to Generate Codes -->
- <classPathEntry.mysql.location>${basedir}/target/${project.artifactId}/WEB-INF/lib/mysql-connector-java-${mysql.connector.java.version}.jar</classPathEntry.mysql.location>
- <javaModelGenerator.targetProject>${basedir}/src/main/java</javaModelGenerator.targetProject>
- <sqlMapGenerator.targetProject>${basedir}/src/main/resources</sqlMapGenerator.targetProject>
- <javaClientGenerator.targetProject>${basedir}/src/main/java</javaClientGenerator.targetProject>
- <mybatis.generator.configurationFile>${basedir}/src/test/resources/generatorConfig.xml</mybatis.generator.configurationFile>
- <mybatis.generator.overwrite>true</mybatis.generator.overwrite>
- </properties>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>${servlet.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <version>${jsp.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${slf4j.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.sun.jmx</groupId>
- <artifactId>jmxri</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.jdmk</groupId>
- <artifactId>jmxtools</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.jms</groupId>
- <artifactId>jms</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>${log4j.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>${commons.lang3.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>${commons.codec.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>${httpcomponents.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>${commons.fileupload.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>${commons.io.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-email</artifactId>
- <version>${commons.email.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-validator</groupId>
- <artifactId>commons-validator</artifactId>
- <version>${commons.validator.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-exec</artifactId>
- <version>${commons.exec.version}</version>
- </dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>${mysql.connector.java.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>tomcat-jdbc</artifactId>
- <version>${tomcat.jdbc.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.mybatis</groupId>
- <artifactId>mybatis</artifactId>
- <version>${mybatis.version}</version>
- </dependency>
- <dependency>
- <groupId>org.mybatis</groupId>
- <artifactId>mybatis-spring</artifactId>
- <version>${mybatis.spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.freemarker</groupId>
- <artifactId>freemarker</artifactId>
- <version>${freemarker.version}</version>
- </dependency>
- <!-- 支持JSON输出 -->
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- <version>${jackson.version}</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>${jackson.version}</version>
- </dependency>
- <dependency>
- <groupId>net.spy</groupId>
- <artifactId>spymemcached</artifactId>
- <version>${spymemcached.version}</version>
- </dependency>
- <!--
- <dependency>
- <groupId>com.jodconverter-code</groupId>
- <artifactId>jodconverter</artifactId>
- <version>2.2.2</version>
- </dependency>
- -->
- </dependencies>
- <build>
- <finalName>oauth2</finalName>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.properties</include>
- <include>**/*.jsp</include>
- </includes>
- <filtering>true</filtering>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-maven-plugin</artifactId>
- <version>8.1.14.v20131031</version>
- <configuration>
- <scanIntervalSeconds>30</scanIntervalSeconds>
- <webApp>
- <contextPath>/</contextPath>
- </webApp>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </project>