在pom.xml加入:

  1. <build>
  2. <finalName>oauth2</finalName>
  3. <resources>
  4. <resource>
  5. <directory>src/main/resources</directory>
  6. <includes>
  7. <include>**/*.xml</include>
  8. <include>**/*.properties</include>
  9. <include>**/*.jsp</include>
  10. </includes>
  11. <filtering>true</filtering>
  12. </resource>
  13. </resources>
  14. <plugins>
  15. <plugin>
  16. <groupId>org.mortbay.jetty</groupId>
  17. <artifactId>jetty-maven-plugin</artifactId>
  18. <version>8.1.14.v20131031</version>
  19. <configuration>
  20. <scanIntervalSeconds>30</scanIntervalSeconds>
  21. <webApp>
  22. <contextPath>/</contextPath>
  23. </webApp>
  24. </configuration>
  25. </plugin>
  26. </plugins>
  27. </build>

或者加入:

  1. <build>
  2. <finalName>oauth2</finalName>
  3. <resources>
  4. <resource>
  5. <directory>src/main/resources</directory>
  6. <includes>
  7. <include>**/*.xml</include>
  8. <include>**/*.properties</include>
  9. <include>**/*.jsp</include>
  10. </includes>
  11. <filtering>true</filtering>
  12. </resource>
  13. </resources>
  14. <plugins>
  15. <plugin>
  16. <groupId>org.apache.maven.plugins</groupId>
  17. <artifactId>maven-compiler-plugin</artifactId>
  18. <version>2.5.1</version>
  19. <configuration>
  20. <source>1.6</source>
  21. <target>1.6</target>
  22. </configuration>
  23. </plugin>
  24. <plugin>
  25. <groupId>org.apache.maven.plugins</groupId>
  26. <artifactId>maven-surefire-plugin</artifactId>
  27. <version>2.12</version>
  28. <configuration>
  29. <includes>
  30. <include>**/*Test.java</include>
  31. </includes>
  32. <excludes>
  33. <exclude>**/Abstract*.java</exclude>
  34. <exclude>**/*Main.java</exclude>
  35. </excludes>
  36. <junitArtifactName>junit:junit</junitArtifactName>
  37. <argLine>-Xmx512m</argLine>
  38. </configuration>
  39. </plugin>
  40. <plugin>
  41. <groupId>org.mybatis.generator</groupId>
  42. <artifactId>mybatis-generator-maven-plugin</artifactId>
  43. <version>${mybatis.generator.version}</version>
  44. </plugin>
  45. <plugin>
  46. <groupId>org.mortbay.jetty</groupId>
  47. <artifactId>jetty-maven-plugin</artifactId>
  48. <version>8.1.14.v20131031</version>
  49. <configuration>
  50. <scanIntervalSeconds>30</scanIntervalSeconds>
  51. <webApp>
  52. <contextPath>/</contextPath>
  53. </webApp>
  54. </configuration>
  55. </plugin>
  56. </plugins>
  57. </build>

整个pom.xml的配置

    1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    3. <modelVersion>4.0.0</modelVersion>
    4. <groupId>com.xuan</groupId>
    5. <artifactId>oauth2</artifactId>
    6. <packaging>war</packaging>
    7. <version>0.0.1-SNAPSHOT</version>
    8. <name>maven</name>
    9. <url>http://maven.apache.org</url>
    10. <properties>
    11. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    12. <junit.version>4.8.2</junit.version>
    13. <servlet.version>2.5</servlet.version>
    14. <jsp.version>2.1</jsp.version>
    15. <slf4j.version>1.6.6</slf4j.version>
    16. <log4j.version>1.2.14</log4j.version>
    17. <commons.lang3.version>3.1</commons.lang3.version>
    18. <commons.codec.version>1.8</commons.codec.version>
    19. <httpcomponents.version>4.2.5</httpcomponents.version>
    20. <commons.fileupload.version>1.2.2</commons.fileupload.version>
    21. <commons.io.version>2.4</commons.io.version>
    22. <commons.email.version>1.2</commons.email.version>
    23. <commons.validator.version>1.4.0</commons.validator.version>
    24. <commons.exec.version>1.2</commons.exec.version>
    25. <mysql.connector.java.version>5.1.25</mysql.connector.java.version>
    26. <tomcat.jdbc.version>7.0.39</tomcat.jdbc.version>
    27. <spring.version>3.1.2.RELEASE</spring.version>
    28. <mybatis.version>3.2.5</mybatis.version>
    29. <mybatis.spring.version>1.2.2</mybatis.spring.version>
    30. <mybatis.generator.version>1.3.2</mybatis.generator.version>
    31. <freemarker.version>2.3.19</freemarker.version>
    32. <jackson.version>2.0.1</jackson.version>
    33. <spymemcached.version>2.10.6</spymemcached.version>
    34. <!-- Used by MyBatis Generator to Generate Codes -->
    35. <classPathEntry.mysql.location>${basedir}/target/${project.artifactId}/WEB-INF/lib/mysql-connector-java-${mysql.connector.java.version}.jar</classPathEntry.mysql.location>
    36. <javaModelGenerator.targetProject>${basedir}/src/main/java</javaModelGenerator.targetProject>
    37. <sqlMapGenerator.targetProject>${basedir}/src/main/resources</sqlMapGenerator.targetProject>
    38. <javaClientGenerator.targetProject>${basedir}/src/main/java</javaClientGenerator.targetProject>
    39. <mybatis.generator.configurationFile>${basedir}/src/test/resources/generatorConfig.xml</mybatis.generator.configurationFile>
    40. <mybatis.generator.overwrite>true</mybatis.generator.overwrite>
    41. </properties>
    42. <dependencies>
    43. <dependency>
    44. <groupId>junit</groupId>
    45. <artifactId>junit</artifactId>
    46. <version>${junit.version}</version>
    47. <scope>test</scope>
    48. </dependency>
    49. <dependency>
    50. <groupId>javax.servlet</groupId>
    51. <artifactId>servlet-api</artifactId>
    52. <version>${servlet.version}</version>
    53. <scope>provided</scope>
    54. </dependency>
    55. <dependency>
    56. <groupId>javax.servlet.jsp</groupId>
    57. <artifactId>jsp-api</artifactId>
    58. <version>${jsp.version}</version>
    59. <scope>provided</scope>
    60. </dependency>
    61. <dependency>
    62. <groupId>org.slf4j</groupId>
    63. <artifactId>slf4j-api</artifactId>
    64. <version>${slf4j.version}</version>
    65. </dependency>
    66. <dependency>
    67. <groupId>org.slf4j</groupId>
    68. <artifactId>slf4j-log4j12</artifactId>
    69. <version>${slf4j.version}</version>
    70. <exclusions>
    71. <exclusion>
    72. <groupId>com.sun.jmx</groupId>
    73. <artifactId>jmxri</artifactId>
    74. </exclusion>
    75. <exclusion>
    76. <groupId>com.sun.jdmk</groupId>
    77. <artifactId>jmxtools</artifactId>
    78. </exclusion>
    79. <exclusion>
    80. <groupId>javax.jms</groupId>
    81. <artifactId>jms</artifactId>
    82. </exclusion>
    83. </exclusions>
    84. </dependency>
    85. <dependency>
    86. <groupId>log4j</groupId>
    87. <artifactId>log4j</artifactId>
    88. <version>${log4j.version}</version>
    89. </dependency>
    90. <dependency>
    91. <groupId>org.apache.commons</groupId>
    92. <artifactId>commons-lang3</artifactId>
    93. <version>${commons.lang3.version}</version>
    94. </dependency>
    95. <dependency>
    96. <groupId>commons-codec</groupId>
    97. <artifactId>commons-codec</artifactId>
    98. <version>${commons.codec.version}</version>
    99. </dependency>
    100. <dependency>
    101. <groupId>org.apache.httpcomponents</groupId>
    102. <artifactId>httpclient</artifactId>
    103. <version>${httpcomponents.version}</version>
    104. </dependency>
    105. <dependency>
    106. <groupId>commons-fileupload</groupId>
    107. <artifactId>commons-fileupload</artifactId>
    108. <version>${commons.fileupload.version}</version>
    109. </dependency>
    110. <dependency>
    111. <groupId>commons-io</groupId>
    112. <artifactId>commons-io</artifactId>
    113. <version>${commons.io.version}</version>
    114. </dependency>
    115. <dependency>
    116. <groupId>org.apache.commons</groupId>
    117. <artifactId>commons-email</artifactId>
    118. <version>${commons.email.version}</version>
    119. </dependency>
    120. <dependency>
    121. <groupId>commons-validator</groupId>
    122. <artifactId>commons-validator</artifactId>
    123. <version>${commons.validator.version}</version>
    124. </dependency>
    125. <dependency>
    126. <groupId>org.apache.commons</groupId>
    127. <artifactId>commons-exec</artifactId>
    128. <version>${commons.exec.version}</version>
    129. </dependency>
    130. <dependency>
    131. <groupId>mysql</groupId>
    132. <artifactId>mysql-connector-java</artifactId>
    133. <version>${mysql.connector.java.version}</version>
    134. </dependency>
    135. <dependency>
    136. <groupId>org.apache.tomcat</groupId>
    137. <artifactId>tomcat-jdbc</artifactId>
    138. <version>${tomcat.jdbc.version}</version>
    139. </dependency>
    140. <dependency>
    141. <groupId>org.springframework</groupId>
    142. <artifactId>spring-core</artifactId>
    143. <version>${spring.version}</version>
    144. </dependency>
    145. <dependency>
    146. <groupId>org.springframework</groupId>
    147. <artifactId>spring-context</artifactId>
    148. <version>${spring.version}</version>
    149. </dependency>
    150. <dependency>
    151. <groupId>org.springframework</groupId>
    152. <artifactId>spring-web</artifactId>
    153. <version>${spring.version}</version>
    154. </dependency>
    155. <dependency>
    156. <groupId>org.springframework</groupId>
    157. <artifactId>spring-webmvc</artifactId>
    158. <version>${spring.version}</version>
    159. </dependency>
    160. <dependency>
    161. <groupId>org.springframework</groupId>
    162. <artifactId>spring-orm</artifactId>
    163. <version>${spring.version}</version>
    164. </dependency>
    165. <dependency>
    166. <groupId>org.springframework</groupId>
    167. <artifactId>spring-tx</artifactId>
    168. <version>${spring.version}</version>
    169. </dependency>
    170. <dependency>
    171. <groupId>org.mybatis</groupId>
    172. <artifactId>mybatis</artifactId>
    173. <version>${mybatis.version}</version>
    174. </dependency>
    175. <dependency>
    176. <groupId>org.mybatis</groupId>
    177. <artifactId>mybatis-spring</artifactId>
    178. <version>${mybatis.spring.version}</version>
    179. </dependency>
    180. <dependency>
    181. <groupId>org.freemarker</groupId>
    182. <artifactId>freemarker</artifactId>
    183. <version>${freemarker.version}</version>
    184. </dependency>
    185. <!-- 支持JSON输出 -->
    186. <dependency>
    187. <groupId>com.fasterxml.jackson.core</groupId>
    188. <artifactId>jackson-core</artifactId>
    189. <version>${jackson.version}</version>
    190. </dependency>
    191. <dependency>
    192. <groupId>com.fasterxml.jackson.core</groupId>
    193. <artifactId>jackson-databind</artifactId>
    194. <version>${jackson.version}</version>
    195. </dependency>
    196. <dependency>
    197. <groupId>net.spy</groupId>
    198. <artifactId>spymemcached</artifactId>
    199. <version>${spymemcached.version}</version>
    200. </dependency>
    201. <!--
    202. <dependency>
    203. <groupId>com.jodconverter-code</groupId>
    204. <artifactId>jodconverter</artifactId>
    205. <version>2.2.2</version>
    206. </dependency>
    207. -->
    208. </dependencies>
    209. <build>
    210. <finalName>oauth2</finalName>
    211. <resources>
    212. <resource>
    213. <directory>src/main/resources</directory>
    214. <includes>
    215. <include>**/*.xml</include>
    216. <include>**/*.properties</include>
    217. <include>**/*.jsp</include>
    218. </includes>
    219. <filtering>true</filtering>
    220. </resource>
    221. </resources>
    222. <plugins>
    223. <plugin>
    224. <groupId>org.mortbay.jetty</groupId>
    225. <artifactId>jetty-maven-plugin</artifactId>
    226. <version>8.1.14.v20131031</version>
    227. <configuration>
    228. <scanIntervalSeconds>30</scanIntervalSeconds>
    229. <webApp>
    230. <contextPath>/</contextPath>
    231. </webApp>
    232. </configuration>
    233. </plugin>
    234. </plugins>
    235. </build>
    236. </project>
05-27 04:20