pom.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. <maven.compiler.source>11</maven.compiler.source>
  13. <maven.compiler.target>11</maven.compiler.target>
  14. <cache2k-version>1.2.3.Final</cache2k-version>
  15. <jackson-version>2.13.4.2</jackson-version>
  16. <!-- This is the default web.xml for plaintext and json only -->
  17. <maven.war.xml>src/main/webapp/WEB-INF/web.xml</maven.war.xml>
  18. </properties>
  19. <dependencies>
  20. <dependency>
  21. <groupId>com.fasterxml.jackson.core</groupId>
  22. <artifactId>jackson-databind</artifactId>
  23. <version>${jackson-version}</version>
  24. </dependency>
  25. <!-- Turn off to use the implementation provided from Resin
  26. <dependency>
  27. <groupId>org.apache.taglibs</groupId>
  28. <artifactId>taglibs-standard-impl</artifactId>
  29. <version>1.2.5</version>
  30. </dependency>
  31. -->
  32. <!-- @Inject -->
  33. <dependency>
  34. <groupId>javax.inject</groupId>
  35. <artifactId>javax.inject</artifactId>
  36. <version>1</version>
  37. </dependency>
  38. <dependency>
  39. <groupId>javax.annotation</groupId>
  40. <artifactId>javax.annotation-api</artifactId>
  41. <version>1.3.2</version>
  42. </dependency>
  43. <!-- Servlet -->
  44. <dependency>
  45. <groupId>javax.servlet</groupId>
  46. <artifactId>servlet-api</artifactId>
  47. <version>2.5</version>
  48. <scope>provided</scope>
  49. </dependency>
  50. <!-- cache2k -->
  51. <dependency>
  52. <groupId>org.cache2k</groupId>
  53. <artifactId>cache2k-base-bom</artifactId>
  54. <version>${cache2k-version}</version>
  55. <type>pom</type>
  56. </dependency>
  57. </dependencies>
  58. <profiles>
  59. <profile>
  60. <id>mysql</id>
  61. <properties>
  62. <maven.war.xml>src/main/resources/WEB-INF/mysql/web.xml</maven.war.xml>
  63. </properties>
  64. <dependencies>
  65. <dependency>
  66. <groupId>mysql</groupId>
  67. <artifactId>mysql-connector-java</artifactId>
  68. <version>8.0.28</version>
  69. </dependency>
  70. </dependencies>
  71. <build>
  72. <plugins>
  73. <plugin>
  74. <groupId>org.apache.maven.plugins</groupId>
  75. <artifactId>maven-war-plugin</artifactId>
  76. <configuration>
  77. <webResources>
  78. <resource>
  79. <directory>src/main/resources/WEB-INF/mysql</directory>
  80. <includes>
  81. <include>resin-web.xml</include>
  82. </includes>
  83. <excludes>
  84. <exclude>src/main/resources/WEB-INF/</exclude>
  85. </excludes>
  86. <targetPath>WEB-INF</targetPath>
  87. </resource>
  88. </webResources>
  89. </configuration>
  90. </plugin>
  91. </plugins>
  92. </build>
  93. </profile>
  94. <profile>
  95. <id>postgresql</id>
  96. <properties>
  97. <maven.war.xml>src/main/resources/WEB-INF/postgresql/web.xml</maven.war.xml>
  98. </properties>
  99. <dependencies>
  100. <dependency>
  101. <groupId>org.postgresql</groupId>
  102. <artifactId>postgresql</artifactId>
  103. <version>42.4.3</version>
  104. </dependency>
  105. </dependencies>
  106. <build>
  107. <plugins>
  108. <plugin>
  109. <groupId>org.apache.maven.plugins</groupId>
  110. <artifactId>maven-war-plugin</artifactId>
  111. <configuration>
  112. <webResources>
  113. <resource>
  114. <directory>src/main/resources/WEB-INF/postgresql</directory>
  115. <includes>
  116. <include>resin-web.xml</include>
  117. </includes>
  118. <excludes>
  119. <exclude>src/main/resources/WEB-INF/</exclude>
  120. </excludes>
  121. <targetPath>WEB-INF</targetPath>
  122. </resource>
  123. </webResources>
  124. </configuration>
  125. </plugin>
  126. </plugins>
  127. </build>
  128. </profile>
  129. </profiles>
  130. <build>
  131. <plugins>
  132. <plugin>
  133. <groupId>org.apache.maven.plugins</groupId>
  134. <artifactId>maven-compiler-plugin</artifactId>
  135. <version>3.8.0</version>
  136. <configuration>
  137. <debug>false</debug>
  138. </configuration>
  139. </plugin>
  140. <plugin>
  141. <groupId>org.apache.maven.plugins</groupId>
  142. <artifactId>maven-war-plugin</artifactId>
  143. <version>3.1.0</version>
  144. <configuration>
  145. <warName>servlet</warName>
  146. <!-- Use the web.xml from the current profile -->
  147. <webXml>${maven.war.xml}</webXml>
  148. </configuration>
  149. </plugin>
  150. </plugins>
  151. </build>
  152. </project>