pom.xml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <parent>
  6. <groupId>com.persagy</groupId>
  7. <artifactId>dmp</artifactId>
  8. <version>4.0.0</version>
  9. </parent>
  10. <modelVersion>4.0.0</modelVersion>
  11. <artifactId>dmp-dic</artifactId>
  12. <dependencies>
  13. <dependency>
  14. <groupId>com.persagy</groupId>
  15. <artifactId>dmp-model</artifactId>
  16. <version>4.0.0</version>
  17. </dependency>
  18. <dependency>
  19. <groupId>com.persagy</groupId>
  20. <artifactId>dmp-common</artifactId>
  21. <version>4.0.0</version>
  22. </dependency>
  23. <dependency>
  24. <groupId>mysql</groupId>
  25. <artifactId>mysql-connector-java</artifactId>
  26. </dependency>
  27. <dependency>
  28. <groupId>com.alibaba</groupId>
  29. <artifactId>druid</artifactId>
  30. <version>1.1.21</version>
  31. </dependency>
  32. <dependency>
  33. <groupId>com.querydsl</groupId>
  34. <artifactId>querydsl-apt</artifactId>
  35. </dependency>
  36. <dependency>
  37. <groupId>com.querydsl</groupId>
  38. <artifactId>querydsl-sql</artifactId>
  39. </dependency>
  40. <dependency>
  41. <groupId>com.querydsl</groupId>
  42. <artifactId>querydsl-jpa</artifactId>
  43. </dependency>
  44. <dependency>
  45. <groupId>org.springframework.boot</groupId>
  46. <artifactId>spring-boot-starter-actuator</artifactId>
  47. </dependency>
  48. <dependency>
  49. <groupId>org.springframework.boot</groupId>
  50. <artifactId>spring-boot-starter-web</artifactId>
  51. </dependency>
  52. <dependency>
  53. <groupId>org.springframework.boot</groupId>
  54. <artifactId>spring-boot-starter-data-jpa</artifactId>
  55. </dependency>
  56. <!-- 注册中心 -->
  57. <dependency>
  58. <groupId>org.springframework.cloud</groupId>
  59. <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
  60. </dependency>
  61. <!-- 配置中心 -->
  62. <dependency>
  63. <groupId>org.springframework.cloud</groupId>
  64. <artifactId>spring-cloud-starter-config</artifactId>
  65. </dependency>
  66. <!-- rabbitmq -->
  67. <dependency>
  68. <groupId>org.springframework.boot</groupId>
  69. <artifactId>spring-boot-starter-amqp</artifactId>
  70. </dependency>
  71. </dependencies>
  72. <build>
  73. <finalName>dmp-dic</finalName>
  74. <plugins>
  75. <plugin>
  76. <groupId>org.springframework.boot</groupId>
  77. <artifactId>spring-boot-maven-plugin</artifactId>
  78. <configuration>
  79. <fork>true</fork>
  80. <jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
  81. </configuration>
  82. <executions>
  83. <execution>
  84. <goals>
  85. <goal>repackage</goal>
  86. </goals>
  87. </execution>
  88. </executions>
  89. </plugin>
  90. <plugin>
  91. <groupId>com.mysema.maven</groupId>
  92. <artifactId>apt-maven-plugin</artifactId>
  93. <version>1.1.3</version>
  94. <executions>
  95. <execution>
  96. <phase>generate-sources</phase>
  97. <goals>
  98. <goal>process</goal>
  99. </goals>
  100. <configuration>
  101. <outputDirectory>target/generated-sources</outputDirectory>
  102. <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
  103. </configuration>
  104. </execution>
  105. </executions>
  106. </plugin>
  107. <!-- 按照测试要求打成zip需要的配置 -->
  108. <!--获取git信息-->
  109. <plugin>
  110. <groupId>pl.project13.maven</groupId>
  111. <artifactId>git-commit-id-plugin</artifactId>
  112. <executions>
  113. <execution>
  114. <goals>
  115. <goal>revision</goal>
  116. </goals>
  117. </execution>
  118. </executions>
  119. <configuration>
  120. <verbose>true</verbose>
  121. <dateFormat>yyyyMMddHHmm</dateFormat>
  122. <generateGitPropertiesFile>true</generateGitPropertiesFile>
  123. <!--<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>-->
  124. <generateGitPropertiesFilename>target/git.properties</generateGitPropertiesFilename>
  125. </configuration>
  126. </plugin>
  127. <plugin>
  128. <groupId>com.coderplus.maven.plugins</groupId>
  129. <artifactId>copy-rename-maven-plugin</artifactId>
  130. <version>1.0.1</version>
  131. <executions>
  132. <execution>
  133. <id>rename-file</id>
  134. <phase>compile</phase>
  135. <goals>
  136. <goal>rename</goal>
  137. </goals>
  138. <configuration>
  139. <sourceFile>${project.build.directory}/git.properties</sourceFile>
  140. <destinationFile>${project.build.directory}/version.txt</destinationFile>
  141. </configuration>
  142. </execution>
  143. </executions>
  144. </plugin>
  145. <!--拷贝资源文件 copy-resources-->
  146. <plugin>
  147. <artifactId>maven-resources-plugin</artifactId>
  148. <executions>
  149. <execution>
  150. <id>copy-resources</id>
  151. <phase>package</phase>
  152. <goals>
  153. <goal>copy-resources</goal>
  154. </goals>
  155. <configuration>
  156. <resources>
  157. <resource>
  158. <directory>src/main/resources/</directory>
  159. <includes>
  160. <include>**/*.yml</include>
  161. </includes>
  162. </resource>
  163. <resource>
  164. <directory>${project.build.directory}</directory>
  165. <includes>
  166. <include>**/version.txt</include>
  167. </includes>
  168. </resource>
  169. </resources>
  170. <outputDirectory>${project.build.directory}/config</outputDirectory>
  171. </configuration>
  172. </execution>
  173. <!--拷贝启动脚本-->
  174. <execution>
  175. <id>copy-version</id>
  176. <phase>package</phase>
  177. <goals>
  178. <goal>copy-resources</goal>
  179. </goals>
  180. <configuration>
  181. <resources>
  182. <resource>
  183. <directory>src/script</directory>
  184. </resource>
  185. </resources>
  186. <outputDirectory>${project.build.directory}</outputDirectory>
  187. </configuration>
  188. </execution>
  189. </executions>
  190. </plugin>
  191. <!-- 打包压缩 -->
  192. <plugin>
  193. <groupId>org.apache.maven.plugins</groupId>
  194. <artifactId>maven-assembly-plugin</artifactId>
  195. <executions>
  196. <execution>
  197. <id>make-assembly</id>
  198. <!-- 当执行mvn package时才会打包 -->
  199. <phase>package</phase>
  200. <goals>
  201. <goal>single</goal>
  202. </goals>
  203. <configuration>
  204. <finalName>
  205. ${project.artifactId}_${git.commit.time}_git_${git.branch}_${git.commit.id.abbrev}
  206. </finalName>
  207. <!--不包含assembly id-->
  208. <appendAssemblyId>false</appendAssemblyId>
  209. <!--输出路径-->
  210. <!--<outputDirectory>../target/co_search-${project.version}</outputDirectory>-->
  211. <descriptors>
  212. <descriptor>src/script/zip.xml</descriptor>
  213. </descriptors>
  214. </configuration>
  215. </execution>
  216. </executions>
  217. </plugin>
  218. </plugins>
  219. </build>
  220. </project>