pom.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4. <modelVersion>4.0.0</modelVersion>
  5. <groupId>hello.world</groupId>
  6. <artifactId>world</artifactId>
  7. <name>Servlet</name>
  8. <packaging>war</packaging>
  9. <version>1.0.0-BUILD-SNAPSHOT</version>
  10. <properties>
  11. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  12. <java-version>1.8</java-version>
  13. <cache2k-version>1.0.2.Final</cache2k-version>
  14. <jackson-version>2.9.3</jackson-version>
  15. <!-- This is the default web.xml for plaintext and json only -->
  16. <maven.war.xml>src/main/webapp/WEB-INF/web.xml</maven.war.xml>
  17. </properties>
  18. <dependencies>
  19. <dependency>
  20. <groupId>com.fasterxml.jackson.core</groupId>
  21. <artifactId>jackson-databind</artifactId>
  22. <version>${jackson-version}</version>
  23. </dependency>
  24. <dependency>
  25. <groupId>com.fasterxml.jackson.module</groupId>
  26. <artifactId>jackson-module-afterburner</artifactId>
  27. <version>${jackson-version}</version>
  28. </dependency>
  29. <dependency>
  30. <groupId>org.apache.taglibs</groupId>
  31. <artifactId>taglibs-standard-impl</artifactId>
  32. <version>1.2.5</version>
  33. </dependency>
  34. <!-- @Inject -->
  35. <dependency>
  36. <groupId>javax.inject</groupId>
  37. <artifactId>javax.inject</artifactId>
  38. <version>1</version>
  39. </dependency>
  40. <!-- Servlet -->
  41. <dependency>
  42. <groupId>javax.servlet</groupId>
  43. <artifactId>servlet-api</artifactId>
  44. <version>2.5</version>
  45. <scope>provided</scope>
  46. </dependency>
  47. <!-- cache2k -->
  48. <dependency>
  49. <groupId>org.cache2k</groupId>
  50. <artifactId>cache2k-api</artifactId>
  51. <version>${cache2k-version}</version>
  52. <scope>provided</scope>
  53. </dependency>
  54. <dependency>
  55. <groupId>org.cache2k</groupId>
  56. <artifactId>cache2k-all</artifactId>
  57. <version>${cache2k-version}</version>
  58. <scope>runtime</scope>
  59. </dependency>
  60. </dependencies>
  61. <profiles>
  62. <profile>
  63. <id>afterburner</id>
  64. <properties>
  65. <maven.war.xml>src/main/resources/WEB-INF/afterburner/web.xml</maven.war.xml>
  66. </properties>
  67. <build>
  68. <plugins>
  69. <plugin>
  70. <groupId>org.apache.maven.plugins</groupId>
  71. <artifactId>maven-war-plugin</artifactId>
  72. <configuration>
  73. <webResources>
  74. <resource>
  75. <directory>src/main/resources/WEB-INF/afterburner</directory>
  76. <excludes>
  77. <exclude>src/main/resources/WEB-INF/</exclude>
  78. </excludes>
  79. <targetPath>WEB-INF</targetPath>
  80. </resource>
  81. </webResources>
  82. </configuration>
  83. </plugin>
  84. </plugins>
  85. </build>
  86. </profile>
  87. <profile>
  88. <id>cjs</id>
  89. <properties>
  90. <maven.war.xml>src/main/resources/WEB-INF/cjs/web.xml</maven.war.xml>
  91. </properties>
  92. <build>
  93. <plugins>
  94. <plugin>
  95. <groupId>org.apache.maven.plugins</groupId>
  96. <artifactId>maven-war-plugin</artifactId>
  97. <configuration>
  98. <webResources>
  99. <resource>
  100. <directory>src/main/resources/WEB-INF/cjs</directory>
  101. <excludes>
  102. <exclude>src/main/resources/WEB-INF/</exclude>
  103. </excludes>
  104. <targetPath>WEB-INF</targetPath>
  105. </resource>
  106. </webResources>
  107. </configuration>
  108. </plugin>
  109. </plugins>
  110. </build>
  111. </profile>
  112. <profile>
  113. <id>mysql</id>
  114. <properties>
  115. <maven.war.xml>src/main/resources/WEB-INF/mysql/web.xml</maven.war.xml>
  116. </properties>
  117. <dependencies>
  118. <dependency>
  119. <groupId>mysql</groupId>
  120. <artifactId>mysql-connector-java</artifactId>
  121. <version>5.1.42</version>
  122. </dependency>
  123. </dependencies>
  124. <build>
  125. <plugins>
  126. <plugin>
  127. <groupId>org.apache.maven.plugins</groupId>
  128. <artifactId>maven-war-plugin</artifactId>
  129. <configuration>
  130. <webResources>
  131. <resource>
  132. <directory>src/main/resources/WEB-INF/mysql</directory>
  133. <includes>
  134. <include>resin-web.xml</include>
  135. </includes>
  136. <excludes>
  137. <exclude>src/main/resources/WEB-INF/</exclude>
  138. </excludes>
  139. <targetPath>WEB-INF</targetPath>
  140. </resource>
  141. </webResources>
  142. </configuration>
  143. </plugin>
  144. </plugins>
  145. </build>
  146. </profile>
  147. <profile>
  148. <id>postgresql</id>
  149. <properties>
  150. <maven.war.xml>src/main/resources/WEB-INF/postgresql/web.xml</maven.war.xml>
  151. </properties>
  152. <dependencies>
  153. <dependency>
  154. <groupId>org.postgresql</groupId>
  155. <artifactId>postgresql</artifactId>
  156. <version>42.1.4</version>
  157. </dependency>
  158. </dependencies>
  159. <build>
  160. <plugins>
  161. <plugin>
  162. <groupId>org.apache.maven.plugins</groupId>
  163. <artifactId>maven-war-plugin</artifactId>
  164. <configuration>
  165. <webResources>
  166. <resource>
  167. <directory>src/main/resources/WEB-INF/postgresql</directory>
  168. <includes>
  169. <include>resin-web.xml</include>
  170. </includes>
  171. <excludes>
  172. <exclude>src/main/resources/WEB-INF/</exclude>
  173. </excludes>
  174. <targetPath>WEB-INF</targetPath>
  175. </resource>
  176. </webResources>
  177. </configuration>
  178. </plugin>
  179. </plugins>
  180. </build>
  181. </profile>
  182. </profiles>
  183. <build>
  184. <plugins>
  185. <plugin>
  186. <groupId>org.apache.maven.plugins</groupId>
  187. <artifactId>maven-compiler-plugin</artifactId>
  188. <version>2.3.2</version>
  189. <configuration>
  190. <source>${java-version}</source>
  191. <target>${java-version}</target>
  192. <optimize>true</optimize>
  193. <debug>false</debug>
  194. </configuration>
  195. </plugin>
  196. <plugin>
  197. <groupId>org.apache.maven.plugins</groupId>
  198. <artifactId>maven-war-plugin</artifactId>
  199. <version>3.1.0</version>
  200. <configuration>
  201. <warName>servlet</warName>
  202. <!-- Use the web.xml from the current profile -->
  203. <webXml>${maven.war.xml}</webXml>
  204. </configuration>
  205. </plugin>
  206. </plugins>
  207. </build>
  208. </project>