pom.xml 17 KB

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