pom.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
  5. http://maven.apache.org/xsd/maven-4.0.0.xsd">
  6. <modelVersion>4.0.0</modelVersion>
  7. <groupId>com.xekm</groupId>
  8. <artifactId>hello-world</artifactId>
  9. <version>0.0.1-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. <dropwizard.version>1.3.12</dropwizard.version>
  15. <javax-activation.version>1.1.1</javax-activation.version>
  16. <jaxb.version>2.3.0</jaxb.version>
  17. <mysql-connector-java.version>8.0.18</mysql-connector-java.version>
  18. <mongojack.version>2.9.4</mongojack.version>
  19. <postgres-jdbc.version>42.3.3</postgres-jdbc.version>
  20. <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
  21. <maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
  22. <maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
  23. <main.class>com.example.helloworld.HelloWorldService</main.class>
  24. <hibernate.version>5.4.24.Final</hibernate.version>
  25. </properties>
  26. <profiles>
  27. <profile>
  28. <id>mysql</id>
  29. <dependencies>
  30. <dependency>
  31. <groupId>mysql</groupId>
  32. <artifactId>mysql-connector-java</artifactId>
  33. <version>${mysql-connector-java.version}</version>
  34. </dependency>
  35. </dependencies>
  36. </profile>
  37. <profile>
  38. <id>mongo</id>
  39. <properties>
  40. <main.class>com.example.helloworld.HelloMongoService</main.class>
  41. </properties>
  42. </profile>
  43. <profile>
  44. <id>postgres</id>
  45. <dependencies>
  46. <dependency>
  47. <groupId>org.postgresql</groupId>
  48. <artifactId>postgresql</artifactId>
  49. <version>${postgres-jdbc.version}</version>
  50. </dependency>
  51. </dependencies>
  52. </profile>
  53. <profile>
  54. <id>jdbi</id>
  55. <properties>
  56. <main.class>com.example.helloworld.HelloJDBIService</main.class>
  57. </properties>
  58. </profile>
  59. </profiles>
  60. <dependencies>
  61. <dependency>
  62. <groupId>io.dropwizard</groupId>
  63. <artifactId>dropwizard-core</artifactId>
  64. <version>${dropwizard.version}</version>
  65. </dependency>
  66. <dependency>
  67. <groupId>io.dropwizard</groupId>
  68. <artifactId>dropwizard-hibernate</artifactId>
  69. <version>${dropwizard.version}</version>
  70. <exclusions>
  71. <exclusion>
  72. <groupId>org.apache.geronimo.specs</groupId>
  73. <artifactId>geronimo-jta_1.1_spec</artifactId>
  74. </exclusion>
  75. <exclusion>
  76. <groupId>javax.transaction</groupId>
  77. <artifactId>jta</artifactId>
  78. </exclusion>
  79. </exclusions>
  80. </dependency>
  81. <dependency>
  82. <groupId>org.hibernate</groupId>
  83. <artifactId>hibernate-core</artifactId>
  84. <version>${hibernate.version}</version>
  85. </dependency>
  86. <dependency>
  87. <groupId>io.dropwizard</groupId>
  88. <artifactId>dropwizard-jdbi3</artifactId>
  89. <version>${dropwizard.version}</version>
  90. </dependency>
  91. <dependency>
  92. <groupId>io.dropwizard</groupId>
  93. <artifactId>dropwizard-views-mustache</artifactId>
  94. <version>${dropwizard.version}</version>
  95. </dependency>
  96. <dependency>
  97. <groupId>org.mongojack</groupId>
  98. <artifactId>mongojack</artifactId>
  99. <version>${mongojack.version}</version>
  100. <exclusions>
  101. <exclusion>
  102. <groupId>com.fasterxml.jackson.core</groupId>
  103. <artifactId>jackson-databind</artifactId>
  104. </exclusion>
  105. <exclusion>
  106. <groupId>javax.persistence</groupId>
  107. <artifactId>persistence-api</artifactId>
  108. </exclusion>
  109. </exclusions>
  110. </dependency>
  111. <dependency>
  112. <groupId>javax.xml.bind</groupId>
  113. <artifactId>jaxb-api</artifactId>
  114. <version>${jaxb.version}</version>
  115. </dependency>
  116. <dependency>
  117. <groupId>javax.activation</groupId>
  118. <artifactId>activation</artifactId>
  119. <version>${javax-activation.version}</version>
  120. </dependency>
  121. </dependencies>
  122. <build>
  123. <plugins>
  124. <plugin>
  125. <groupId>org.apache.maven.plugins</groupId>
  126. <artifactId>maven-compiler-plugin</artifactId>
  127. <version>${maven-compiler-plugin.version}</version>
  128. <configuration>
  129. <debug>false</debug>
  130. </configuration>
  131. </plugin>
  132. <plugin>
  133. <groupId>org.apache.maven.plugins</groupId>
  134. <artifactId>maven-jar-plugin</artifactId>
  135. <version>${maven-jar-plugin.version}</version>
  136. <configuration>
  137. <archive>
  138. <manifest>
  139. <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
  140. </manifest>
  141. </archive>
  142. </configuration>
  143. </plugin>
  144. <plugin>
  145. <groupId>org.apache.maven.plugins</groupId>
  146. <artifactId>maven-shade-plugin</artifactId>
  147. <version>${maven-shade-plugin.version}</version>
  148. <configuration>
  149. <createDependencyReducedPom>true</createDependencyReducedPom>
  150. <filters>
  151. <filter>
  152. <artifact>*:*</artifact>
  153. <excludes>
  154. <exclude>META-INF/*.SF</exclude>
  155. <exclude>META-INF/*.DSA</exclude>
  156. <exclude>META-INF/*.RSA</exclude>
  157. </excludes>
  158. </filter>
  159. </filters>
  160. </configuration>
  161. <executions>
  162. <execution>
  163. <phase>package</phase>
  164. <goals>
  165. <goal>shade</goal>
  166. </goals>
  167. <configuration>
  168. <transformers>
  169. <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
  170. <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
  171. <mainClass>${main.class}</mainClass>
  172. </transformer>
  173. </transformers>
  174. </configuration>
  175. </execution>
  176. </executions>
  177. </plugin>
  178. </plugins>
  179. </build>
  180. </project>