pom.xml 5.1 KB

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