pom.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  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. <artifactId>bnt</artifactId>
  7. <groupId>cn.reghao.bnt</groupId>
  8. <version>1.0.0</version>
  9. </parent>
  10. <modelVersion>4.0.0</modelVersion>
  11. <artifactId>web</artifactId>
  12. <version>1.0.0</version>
  13. <packaging>jar</packaging>
  14. <properties>
  15. <project.build.outputDir>${project.basedir}/bin</project.build.outputDir>
  16. <springboot.version>2.6.15</springboot.version>
  17. </properties>
  18. <dependencyManagement>
  19. <dependencies>
  20. <dependency>
  21. <groupId>org.springframework.boot</groupId>
  22. <artifactId>spring-boot-dependencies</artifactId>
  23. <version>${springboot.version}</version>
  24. <type>pom</type>
  25. <scope>import</scope>
  26. </dependency>
  27. </dependencies>
  28. </dependencyManagement>
  29. <dependencies>
  30. <dependency>
  31. <groupId>cn.reghao.jutil</groupId>
  32. <artifactId>jdk</artifactId>
  33. <version>1.0.0-SNAPSHOT</version>
  34. </dependency>
  35. <!--<dependency>
  36. <groupId>cn.reghao.jutil</groupId>
  37. <artifactId>tool</artifactId>
  38. <version>1.0.0-SNAPSHOT</version>
  39. </dependency>
  40. <dependency>
  41. <groupId>cn.reghao.jutil</groupId>
  42. <artifactId>validator</artifactId>
  43. <version>1.0.0-SNAPSHOT</version>
  44. </dependency>-->
  45. <dependency>
  46. <groupId>cn.reghao.bnt</groupId>
  47. <artifactId>common</artifactId>
  48. <version>1.0.0-SNAPSHOT</version>
  49. </dependency>
  50. <dependency>
  51. <groupId>ch.qos.logback</groupId>
  52. <artifactId>logback-core</artifactId>
  53. <version>1.2.3</version>
  54. </dependency>
  55. <dependency>
  56. <groupId>ch.qos.logback</groupId>
  57. <artifactId>logback-classic</artifactId>
  58. <version>1.2.3</version>
  59. </dependency>
  60. <dependency>
  61. <groupId>cn.reghao.jutil</groupId>
  62. <artifactId>web</artifactId>
  63. <version>1.0.0-SNAPSHOT</version>
  64. </dependency>
  65. <dependency>
  66. <groupId>org.springframework.boot</groupId>
  67. <artifactId>spring-boot-starter-web</artifactId>
  68. </dependency>
  69. <dependency>
  70. <groupId>org.springframework.boot</groupId>
  71. <artifactId>spring-boot-starter-websocket</artifactId>
  72. </dependency>
  73. <dependency>
  74. <groupId>org.springframework.boot</groupId>
  75. <artifactId>spring-boot-starter-test</artifactId>
  76. <scope>test</scope>
  77. </dependency>
  78. <dependency>
  79. <groupId>org.springframework.boot</groupId>
  80. <artifactId>spring-boot-starter-security</artifactId>
  81. </dependency>
  82. <dependency>
  83. <groupId>org.springframework.session</groupId>
  84. <artifactId>spring-session-jdbc</artifactId>
  85. </dependency>
  86. <dependency>
  87. <groupId>org.springframework.boot</groupId>
  88. <artifactId>spring-boot-starter-cache</artifactId>
  89. </dependency>
  90. <dependency>
  91. <groupId>com.github.ben-manes.caffeine</groupId>
  92. <artifactId>caffeine</artifactId>
  93. </dependency>
  94. <dependency>
  95. <groupId>mysql</groupId>
  96. <artifactId>mysql-connector-java</artifactId>
  97. <version>8.0.17</version>
  98. </dependency>
  99. <dependency>
  100. <groupId>com.zaxxer</groupId>
  101. <artifactId>HikariCP</artifactId>
  102. <version>3.3.1</version>
  103. </dependency>
  104. <dependency>
  105. <groupId>org.springframework.boot</groupId>
  106. <artifactId>spring-boot-starter-data-jpa</artifactId>
  107. </dependency>
  108. <dependency>
  109. <groupId>org.springframework.boot</groupId>
  110. <artifactId>spring-boot-starter-validation</artifactId>
  111. </dependency>
  112. <dependency>
  113. <groupId>org.springframework.boot</groupId>
  114. <artifactId>spring-boot-starter-freemarker</artifactId>
  115. </dependency>
  116. <dependency>
  117. <groupId>org.springdoc</groupId>
  118. <artifactId>springdoc-openapi-ui</artifactId>
  119. <version>1.7.0</version>
  120. </dependency>
  121. <!--########################################################################################################-->
  122. <!-- blog 模块依赖 -->
  123. <dependency>
  124. <groupId>org.jsoup</groupId>
  125. <artifactId>jsoup</artifactId>
  126. <version>1.12.1</version>
  127. </dependency>
  128. <dependency>
  129. <groupId>com.atlassian.commonmark</groupId>
  130. <artifactId>commonmark</artifactId>
  131. <version>0.12.1</version>
  132. </dependency>
  133. <dependency>
  134. <groupId>com.atlassian.commonmark</groupId>
  135. <artifactId>commonmark-ext-gfm-tables</artifactId>
  136. <version>0.12.1</version>
  137. </dependency>
  138. <dependency>
  139. <groupId>com.atlassian.commonmark</groupId>
  140. <artifactId>commonmark-ext-yaml-front-matter</artifactId>
  141. <version>0.12.1</version>
  142. </dependency>
  143. <!--########################################################################################################-->
  144. <!-- lucene 搜索依赖 -->
  145. <dependency>
  146. <groupId>org.hibernate.search</groupId>
  147. <artifactId>hibernate-search-mapper-orm</artifactId>
  148. <version>6.2.4.Final</version>
  149. </dependency>
  150. <dependency>
  151. <groupId>org.hibernate.search</groupId>
  152. <artifactId>hibernate-search-backend-lucene</artifactId>
  153. <version>6.2.4.Final</version>
  154. </dependency>
  155. <dependency>
  156. <groupId>org.apache.lucene</groupId>
  157. <artifactId>lucene-core</artifactId>
  158. <version>8.11.2</version>
  159. </dependency>
  160. <dependency>
  161. <groupId>org.apache.lucene</groupId>
  162. <artifactId>lucene-queryparser</artifactId>
  163. <version>8.11.2</version>
  164. </dependency>
  165. <dependency>
  166. <groupId>org.apache.lucene</groupId>
  167. <artifactId>lucene-highlighter</artifactId>
  168. <version>8.11.2</version>
  169. </dependency>
  170. <dependency>
  171. <groupId>com.github.magese</groupId>
  172. <artifactId>ik-analyzer</artifactId>
  173. <version>8.5.0</version>
  174. </dependency>
  175. <!--########################################################################################################-->
  176. <!-- 监控报警依赖 -->
  177. <dependency>
  178. <groupId>org.springframework.boot</groupId>
  179. <artifactId>spring-boot-starter-actuator</artifactId>
  180. </dependency>
  181. <dependency>
  182. <groupId>io.micrometer</groupId>
  183. <artifactId>micrometer-core</artifactId>
  184. </dependency>
  185. <dependency>
  186. <groupId>io.micrometer</groupId>
  187. <artifactId>micrometer-registry-prometheus</artifactId>
  188. </dependency>
  189. <!--########################################################################################################-->
  190. <!-- devops 模块依赖 -->
  191. <dependency>
  192. <groupId>org.eclipse.jgit</groupId>
  193. <artifactId>org.eclipse.jgit</artifactId>
  194. <version>6.4.0.202211300538-r</version>
  195. </dependency>
  196. <dependency>
  197. <groupId>org.eclipse.jgit</groupId>
  198. <artifactId>org.eclipse.jgit.ssh.apache</artifactId>
  199. <version>6.4.0.202211300538-r</version>
  200. </dependency>
  201. <dependency>
  202. <groupId>org.apache.maven</groupId>
  203. <artifactId>maven-model</artifactId>
  204. <version>3.6.0</version>
  205. </dependency>
  206. <dependency>
  207. <groupId>org.apache.maven.shared</groupId>
  208. <artifactId>maven-invoker</artifactId>
  209. <version>3.0.1</version>
  210. </dependency>
  211. <dependency>
  212. <groupId>com.jcraft</groupId>
  213. <artifactId>jsch</artifactId>
  214. <version>0.1.55</version>
  215. </dependency>
  216. <dependency>
  217. <groupId>commons-io</groupId>
  218. <artifactId>commons-io</artifactId>
  219. <version>2.6</version>
  220. </dependency>
  221. <!-- 阿里云 sdk 依赖 -->
  222. <dependency>
  223. <groupId>com.aliyun.oss</groupId>
  224. <artifactId>aliyun-sdk-oss</artifactId>
  225. <version>3.8.0</version>
  226. </dependency>
  227. <dependency>
  228. <groupId>com.aliyun</groupId>
  229. <artifactId>cdn20180510</artifactId>
  230. <version>3.2.0</version>
  231. </dependency>
  232. <dependency>
  233. <groupId>com.aliyun</groupId>
  234. <artifactId>sts20150401</artifactId>
  235. <version>1.1.4</version>
  236. </dependency>
  237. </dependencies>
  238. <profiles>
  239. <profile>
  240. <id>dev</id>
  241. <properties>
  242. <profile.active>dev</profile.active>
  243. </properties>
  244. <activation>
  245. <activeByDefault>true</activeByDefault>
  246. </activation>
  247. </profile>
  248. <profile>
  249. <id>test</id>
  250. <properties>
  251. <profile.active>test</profile.active>
  252. </properties>
  253. </profile>
  254. <profile>
  255. <id>prod</id>
  256. <properties>
  257. <profile.active>prod</profile.active>
  258. </properties>
  259. </profile>
  260. </profiles>
  261. <build>
  262. <finalName>bnt${project.artifactId}</finalName>
  263. <resources>
  264. <resource>
  265. <directory>src/main/resources</directory>
  266. <filtering>true</filtering>
  267. <includes>
  268. <include>banner.txt</include>
  269. <include>application.yml</include>
  270. <include>application-${profile.active}.yml</include>
  271. <include>logback-spring.xml</include>
  272. <include>git.properties</include>
  273. <!-- 前端静态资源 -->
  274. <include>static/**</include>
  275. <include>templates/**</include>
  276. </includes>
  277. </resource>
  278. </resources>
  279. <plugins>
  280. <plugin>
  281. <groupId>org.apache.maven.plugins</groupId>
  282. <artifactId>maven-compiler-plugin</artifactId>
  283. <version>3.8.1</version>
  284. <configuration>
  285. <source>11</source>
  286. <target>11</target>
  287. </configuration>
  288. </plugin>
  289. <plugin>
  290. <groupId>org.apache.maven.plugins</groupId>
  291. <artifactId>maven-resources-plugin</artifactId>
  292. <version>2.4.3</version>
  293. <configuration>
  294. <!-- 让 maven 不处理字体 -->
  295. <nonFilteredFileExtensions>
  296. <nonFilteredFileExtension>ttf</nonFilteredFileExtension>
  297. <nonFilteredFileExtension>woff</nonFilteredFileExtension>
  298. <nonFilteredFileExtension>woff2</nonFilteredFileExtension>
  299. <nonFilteredFileExtension>fbx</nonFilteredFileExtension>
  300. </nonFilteredFileExtensions>
  301. </configuration>
  302. </plugin>
  303. <plugin>
  304. <groupId>org.springframework.boot</groupId>
  305. <artifactId>spring-boot-maven-plugin</artifactId>
  306. <version>${springboot.version}</version>
  307. <executions>
  308. <execution>
  309. <goals>
  310. <goal>repackage</goal>
  311. </goals>
  312. </execution>
  313. </executions>
  314. <configuration>
  315. <!-- 生成的 jar 包输出到指定目录 -->
  316. <outputDirectory>${project.build.outputDir}</outputDirectory>
  317. </configuration>
  318. </plugin>
  319. <!--git-commit-id-plugin 插件,用于实现打包带git版本信息-->
  320. <plugin>
  321. <groupId>pl.project13.maven</groupId>
  322. <artifactId>git-commit-id-plugin</artifactId>
  323. <version>2.1.5</version>
  324. <executions>
  325. <execution>
  326. <goals>
  327. <goal>revision</goal>
  328. </goals>
  329. </execution>
  330. </executions>
  331. <configuration>
  332. <!--日期格式;默认值:dd.MM.yyyy '@' HH:mm:ss z;-->
  333. <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
  334. <!--,构建过程中,是否打印详细信息;默认值:false;-->
  335. <verbose>true</verbose>
  336. <!-- ".git"文件路径;默认值:${project.basedir}/.git;
  337. 注意: 如果是多模块(多模块)项目,则需要修改到.git文件夹的目录-->
  338. <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
  339. <!--若项目打包类型为pom,是否取消构建;默认值:true;-->
  340. <skipPoms>false</skipPoms>
  341. <!--是否生成"git.properties"文件;默认值:false;-->
  342. <generateGitPropertiesFile>true</generateGitPropertiesFile>
  343. <!--指定"git.properties"文件的存放路径(相对于${project.basedir}的一个路径);
  344. 注意:该地址决定接口代码是否可以读取到git版本信息,请自行修改-->
  345. <generateGitPropertiesFilename>src/main/resources/git.properties</generateGitPropertiesFilename>
  346. <!--".git"文件夹未找到时,构建是否失败;若设置true,则构建失败;若设置false,则跳过执行该目标;默认值:true;-->
  347. <failOnNoGitDirectory>true</failOnNoGitDirectory>
  348. <!--git描述配置,可选;由JGit提供实现;-->
  349. <gitDescribe>
  350. <!--是否生成描述属性-->
  351. <skip>false</skip>
  352. <!--提交操作未发现tag时,仅打印提交操作ID,-->
  353. <always>false</always>
  354. <!--提交操作ID显式字符长度,最大值为:40;默认值:7;
  355. 0代表特殊意义;后面有解释;
  356. -->
  357. <abbrev>8</abbrev>
  358. <!--构建触发时,代码有修改时(即"dirty state"),添加指定后缀;默认值:"";-->
  359. <dirty>-dirty</dirty>
  360. <!--always print using the "tag-commits_from_tag-g_commit_id-maybe_dirty" format, even if "on" a tag.
  361. The distance will always be 0 if you're "on" the tag.
  362. -->
  363. <forceLongFormat>false</forceLongFormat>
  364. </gitDescribe>
  365. </configuration>
  366. </plugin>
  367. <!--apache maven插件,用于执行ant脚本函数-->
  368. <plugin>
  369. <groupId>org.apache.maven.plugins</groupId>
  370. <artifactId>maven-antrun-plugin</artifactId>
  371. <version>1.8</version>
  372. <executions>
  373. <execution>
  374. <!--maven 插件生命周期,我试过用compile 发现打包以后没有git.properties,因为打包的时候,还没有生成
  375. 注意,这里改成 initialize 的话, 上面 git-commit-id-plugin 插件对应也该添加 phase 配置,并设置为 initialize
  376. 否则你生成的文件,写入的就不会对应的值,而是变量名-->
  377. <phase>initialize</phase>
  378. <goals>
  379. <goal>run</goal>
  380. </goals>
  381. <configuration>
  382. <tasks>
  383. <echo message="写入 git 版本信息"/>
  384. <!-- concat 常用于把一些信息写入文件,我这里用于把 git-commit-id-plugin 生成的git环境变量写入文件 -->
  385. <concat destfile="src/main/resources/git.properties">
  386. repo=${git.remote.origin.url}
  387. branch=${git.branch}
  388. commitId=${git.commit.id.abbrev}
  389. commitTime=${git.commit.time}
  390. buildTime=${git.build.time}
  391. </concat>
  392. </tasks>
  393. </configuration>
  394. </execution>
  395. </executions>
  396. </plugin>
  397. </plugins>
  398. </build>
  399. </project>