pom.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  4. <modelVersion>4.0.0</modelVersion>
  5. <parent>
  6. <groupId>org.springframework.boot</groupId>
  7. <artifactId>spring-boot-starter-parent</artifactId>
  8. <version>2.2.2.RELEASE</version>
  9. <relativePath/> <!-- lookup parent from repository -->
  10. </parent>
  11. <groupId>com.persagy</groupId>
  12. <artifactId>alarm-engine</artifactId>
  13. <version>0.0.1-SNAPSHOT</version>
  14. <name>alarm-engine</name>
  15. <description>project alarm program</description>
  16. <properties>
  17. <java.version>1.8</java.version>
  18. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  19. <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  20. </properties>
  21. <dependencies>
  22. <dependency>
  23. <groupId>org.springframework.boot</groupId>
  24. <artifactId>spring-boot-starter</artifactId>
  25. </dependency>
  26. <dependency>
  27. <groupId>org.springframework.boot</groupId>
  28. <artifactId>spring-boot-starter-web</artifactId>
  29. </dependency>
  30. <!-- swagger -->
  31. <dependency>
  32. <groupId>com.github.xiaoymin</groupId>
  33. <artifactId>knife4j-spring-boot-starter</artifactId>
  34. <!--在引用时请在maven中央仓库搜索最新版本号 -->
  35. <version>2.0.2</version>
  36. </dependency>
  37. <!--guava-->
  38. <dependency>
  39. <groupId>com.google.guava</groupId>
  40. <artifactId>guava</artifactId>
  41. <version>20.0</version>
  42. </dependency>
  43. <!--lombok-->
  44. <dependency>
  45. <groupId>org.projectlombok</groupId>
  46. <artifactId>lombok</artifactId>
  47. <optional>true</optional>
  48. </dependency>
  49. <!-- 数学逻辑运算解析库-->
  50. <dependency>
  51. <groupId>com.googlecode.aviator</groupId>
  52. <artifactId>aviator</artifactId>
  53. <version>5.1.4</version>
  54. </dependency>
  55. <!-- netty -->
  56. <dependency>
  57. <groupId>io.netty</groupId>
  58. <artifactId>netty-all</artifactId>
  59. <version>4.1.42.Final</version>
  60. </dependency>
  61. <!--测试工具-->
  62. <dependency>
  63. <groupId>org.springframework.boot</groupId>
  64. <artifactId>spring-boot-starter-test</artifactId>
  65. <scope>test</scope>
  66. <exclusions>
  67. <exclusion>
  68. <groupId>org.junit.vintage</groupId>
  69. <artifactId>junit-vintage-engine</artifactId>
  70. </exclusion>
  71. </exclusions>
  72. </dependency>
  73. <!--WebSocket核心依赖包-->
  74. <dependency>
  75. <groupId>org.springframework.boot</groupId>
  76. <artifactId>spring-boot-starter-websocket</artifactId>
  77. </dependency>
  78. <!--WebSocket核心依赖包-->
  79. <dependency>
  80. <groupId>org.java-websocket</groupId>
  81. <artifactId>Java-WebSocket</artifactId>
  82. <version>1.3.8</version>
  83. </dependency>
  84. <!-- <dependency>-->
  85. <!-- <groupId>junit</groupId>-->
  86. <!-- <artifactId>junit</artifactId>-->
  87. <!-- </dependency>-->
  88. <!-- commons-lang3常用工具类-->
  89. <dependency>
  90. <groupId>org.apache.commons</groupId>
  91. <artifactId>commons-lang3</artifactId>
  92. </dependency>
  93. <!--fastjson JSON组件-->
  94. <dependency>
  95. <groupId>com.alibaba</groupId>
  96. <artifactId>fastjson</artifactId>
  97. <version>1.2.71</version>
  98. <scope>compile</scope>
  99. </dependency>
  100. <!--hutool工具类-->
  101. <dependency>
  102. <groupId>cn.hutool</groupId>
  103. <artifactId>hutool-all</artifactId>
  104. <version>5.4.3</version>
  105. <scope>compile</scope>
  106. </dependency>
  107. <!--定时任务框架-->
  108. <dependency>
  109. <groupId>org.springframework.boot</groupId>
  110. <artifactId>spring-boot-starter-quartz</artifactId>
  111. </dependency>
  112. <!-- MYSQL-->
  113. <dependency>
  114. <groupId>mysql</groupId>
  115. <artifactId>mysql-connector-java</artifactId>
  116. <scope>runtime</scope>
  117. </dependency>
  118. <!-- Spring Boot JDBC-->
  119. <dependency>
  120. <groupId>org.springframework.boot</groupId>
  121. <artifactId>spring-boot-starter-jdbc</artifactId>
  122. </dependency>
  123. <!-- 数据库连接池-->
  124. <dependency>
  125. <groupId>com.alibaba</groupId>
  126. <artifactId>druid-spring-boot-starter</artifactId>
  127. <version>1.1.22</version>
  128. </dependency>
  129. <!-- spring-data-jpa -->
  130. <dependency>
  131. <groupId>org.springframework.boot</groupId>
  132. <artifactId>spring-boot-starter-data-jpa</artifactId>
  133. </dependency>
  134. <dependency>
  135. <groupId>org.springframework.boot</groupId>
  136. <artifactId>spring-boot-starter-aop</artifactId>
  137. </dependency>
  138. <dependency>
  139. <groupId>com.github.dadiyang</groupId>
  140. <artifactId>autologging-aop</artifactId>
  141. <version>1.0.0</version>
  142. </dependency>
  143. </dependencies>
  144. <build>
  145. <finalName>alarm-engine</finalName>
  146. <plugins>
  147. <plugin>
  148. <groupId>org.apache.maven.plugins</groupId>
  149. <artifactId>maven-compiler-plugin</artifactId>
  150. <version>3.8.1</version>
  151. <configuration>
  152. <source>1.8</source>
  153. <target>1.8</target>
  154. <encoding>UTF-8</encoding>
  155. <skip>true</skip>
  156. </configuration>
  157. </plugin>
  158. <plugin>
  159. <groupId>org.springframework.boot</groupId>
  160. <artifactId>spring-boot-maven-plugin</artifactId>
  161. </plugin>
  162. <!-- 按照测试要求打成zip需要的配置 -->
  163. <!--获取git信息-->
  164. <plugin>
  165. <groupId>pl.project13.maven</groupId>
  166. <artifactId>git-commit-id-plugin</artifactId>
  167. <executions>
  168. <execution>
  169. <goals>
  170. <goal>revision</goal>
  171. </goals>
  172. </execution>
  173. </executions>
  174. <configuration>
  175. <verbose>true</verbose>
  176. <dateFormat>yyyyMMddHHmm</dateFormat>
  177. <generateGitPropertiesFile>true</generateGitPropertiesFile>
  178. <!--<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>-->
  179. <generateGitPropertiesFilename>target/git.properties</generateGitPropertiesFilename>
  180. </configuration>
  181. </plugin>
  182. <plugin>
  183. <groupId>com.coderplus.maven.plugins</groupId>
  184. <artifactId>copy-rename-maven-plugin</artifactId>
  185. <version>1.0.1</version>
  186. <executions>
  187. <execution>
  188. <id>rename-file</id>
  189. <phase>compile</phase>
  190. <goals>
  191. <goal>rename</goal>
  192. </goals>
  193. <configuration>
  194. <sourceFile>${project.build.directory}/git.properties</sourceFile>
  195. <destinationFile>${project.build.directory}/version.txt</destinationFile>
  196. </configuration>
  197. </execution>
  198. </executions>
  199. </plugin>
  200. <!--拷贝资源文件 copy-resources-->
  201. <plugin>
  202. <artifactId>maven-resources-plugin</artifactId>
  203. <executions>
  204. <execution>
  205. <id>copy-resources</id>
  206. <phase>package</phase>
  207. <goals>
  208. <goal>copy-resources</goal>
  209. </goals>
  210. <configuration>
  211. <resources>
  212. <resource>
  213. <directory>src/main/resources/</directory>
  214. <includes>
  215. <include>**/*.yml</include>
  216. </includes>
  217. </resource>
  218. <resource>
  219. <directory>${project.build.directory}</directory>
  220. <includes>
  221. <include>**/version.txt</include>
  222. </includes>
  223. </resource>
  224. </resources>
  225. <outputDirectory>${project.build.directory}/config</outputDirectory>
  226. </configuration>
  227. </execution>
  228. <!--拷贝启动脚本-->
  229. <execution>
  230. <id>copy-version</id>
  231. <phase>package</phase>
  232. <goals>
  233. <goal>copy-resources</goal>
  234. </goals>
  235. <configuration>
  236. <resources>
  237. <resource>
  238. <directory>src/script</directory>
  239. </resource>
  240. </resources>
  241. <outputDirectory>${project.build.directory}</outputDirectory>
  242. </configuration>
  243. </execution>
  244. </executions>
  245. </plugin>
  246. <!-- 打包压缩 -->
  247. <plugin>
  248. <groupId>org.apache.maven.plugins</groupId>
  249. <artifactId>maven-assembly-plugin</artifactId>
  250. <executions>
  251. <execution>
  252. <id>make-assembly</id>
  253. <!-- 当执行mvn package时才会打包 -->
  254. <phase>package</phase>
  255. <goals>
  256. <goal>single</goal>
  257. </goals>
  258. <configuration>
  259. <finalName>
  260. ${project.artifactId}_${git.commit.time}_git_${git.branch}_${git.commit.id.abbrev}
  261. </finalName>
  262. <!--不包含assembly id-->
  263. <appendAssemblyId>false</appendAssemblyId>
  264. <!--输出路径-->
  265. <!--<outputDirectory>../target/co_search-${project.version}</outputDirectory>-->
  266. <descriptors>
  267. <descriptor>src/script/zip.xml</descriptor>
  268. </descriptors>
  269. </configuration>
  270. </execution>
  271. </executions>
  272. </plugin>
  273. </plugins>
  274. </build>
  275. </project>