pom.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  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. </dependencies>
  242. <profiles>
  243. <profile>
  244. <id>dev</id>
  245. <properties>
  246. <profile.active>dev</profile.active>
  247. </properties>
  248. <activation>
  249. <activeByDefault>true</activeByDefault>
  250. </activation>
  251. </profile>
  252. <profile>
  253. <id>test</id>
  254. <properties>
  255. <profile.active>test</profile.active>
  256. </properties>
  257. </profile>
  258. <profile>
  259. <id>prod</id>
  260. <properties>
  261. <profile.active>prod</profile.active>
  262. </properties>
  263. </profile>
  264. </profiles>
  265. <build>
  266. <finalName>bnt${project.artifactId}</finalName>
  267. <resources>
  268. <resource>
  269. <directory>src/main/resources</directory>
  270. <filtering>true</filtering>
  271. <includes>
  272. <include>banner.txt</include>
  273. <include>application.yml</include>
  274. <include>application-${profile.active}.yml</include>
  275. <include>logback-spring.xml</include>
  276. <include>git.properties</include>
  277. <!-- 前端静态资源 -->
  278. <include>static/**</include>
  279. <include>templates/**</include>
  280. </includes>
  281. </resource>
  282. </resources>
  283. <plugins>
  284. <plugin>
  285. <groupId>org.apache.maven.plugins</groupId>
  286. <artifactId>maven-compiler-plugin</artifactId>
  287. <version>3.8.1</version>
  288. <configuration>
  289. <source>11</source>
  290. <target>11</target>
  291. </configuration>
  292. </plugin>
  293. <plugin>
  294. <groupId>org.apache.maven.plugins</groupId>
  295. <artifactId>maven-resources-plugin</artifactId>
  296. <version>2.4.3</version>
  297. <configuration>
  298. <!-- 让 maven 不处理字体 -->
  299. <nonFilteredFileExtensions>
  300. <nonFilteredFileExtension>ttf</nonFilteredFileExtension>
  301. <nonFilteredFileExtension>woff</nonFilteredFileExtension>
  302. <nonFilteredFileExtension>woff2</nonFilteredFileExtension>
  303. <nonFilteredFileExtension>fbx</nonFilteredFileExtension>
  304. </nonFilteredFileExtensions>
  305. </configuration>
  306. </plugin>
  307. <plugin>
  308. <groupId>org.springframework.boot</groupId>
  309. <artifactId>spring-boot-maven-plugin</artifactId>
  310. <version>${springboot.version}</version>
  311. <executions>
  312. <execution>
  313. <goals>
  314. <goal>repackage</goal>
  315. </goals>
  316. </execution>
  317. </executions>
  318. <configuration>
  319. <!-- 生成的 jar 包输出到指定目录 -->
  320. <outputDirectory>${project.build.outputDir}</outputDirectory>
  321. </configuration>
  322. </plugin>
  323. <!--git-commit-id-plugin 插件,用于实现打包带git版本信息-->
  324. <plugin>
  325. <groupId>pl.project13.maven</groupId>
  326. <artifactId>git-commit-id-plugin</artifactId>
  327. <version>2.1.5</version>
  328. <executions>
  329. <execution>
  330. <goals>
  331. <goal>revision</goal>
  332. </goals>
  333. </execution>
  334. </executions>
  335. <configuration>
  336. <!--日期格式;默认值:dd.MM.yyyy '@' HH:mm:ss z;-->
  337. <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
  338. <!--,构建过程中,是否打印详细信息;默认值:false;-->
  339. <verbose>true</verbose>
  340. <!-- ".git"文件路径;默认值:${project.basedir}/.git;
  341. 注意: 如果是多模块(多模块)项目,则需要修改到.git文件夹的目录-->
  342. <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
  343. <!--若项目打包类型为pom,是否取消构建;默认值:true;-->
  344. <skipPoms>false</skipPoms>
  345. <!--是否生成"git.properties"文件;默认值:false;-->
  346. <generateGitPropertiesFile>true</generateGitPropertiesFile>
  347. <!--指定"git.properties"文件的存放路径(相对于${project.basedir}的一个路径);
  348. 注意:该地址决定接口代码是否可以读取到git版本信息,请自行修改-->
  349. <generateGitPropertiesFilename>src/main/resources/git.properties</generateGitPropertiesFilename>
  350. <!--".git"文件夹未找到时,构建是否失败;若设置true,则构建失败;若设置false,则跳过执行该目标;默认值:true;-->
  351. <failOnNoGitDirectory>true</failOnNoGitDirectory>
  352. <!--git描述配置,可选;由JGit提供实现;-->
  353. <gitDescribe>
  354. <!--是否生成描述属性-->
  355. <skip>false</skip>
  356. <!--提交操作未发现tag时,仅打印提交操作ID,-->
  357. <always>false</always>
  358. <!--提交操作ID显式字符长度,最大值为:40;默认值:7;
  359. 0代表特殊意义;后面有解释;
  360. -->
  361. <abbrev>8</abbrev>
  362. <!--构建触发时,代码有修改时(即"dirty state"),添加指定后缀;默认值:"";-->
  363. <dirty>-dirty</dirty>
  364. <!--always print using the "tag-commits_from_tag-g_commit_id-maybe_dirty" format, even if "on" a tag.
  365. The distance will always be 0 if you're "on" the tag.
  366. -->
  367. <forceLongFormat>false</forceLongFormat>
  368. </gitDescribe>
  369. </configuration>
  370. </plugin>
  371. <!--apache maven插件,用于执行ant脚本函数-->
  372. <plugin>
  373. <groupId>org.apache.maven.plugins</groupId>
  374. <artifactId>maven-antrun-plugin</artifactId>
  375. <version>1.8</version>
  376. <executions>
  377. <execution>
  378. <!--maven 插件生命周期,我试过用compile 发现打包以后没有git.properties,因为打包的时候,还没有生成
  379. 注意,这里改成 initialize 的话, 上面 git-commit-id-plugin 插件对应也该添加 phase 配置,并设置为 initialize
  380. 否则你生成的文件,写入的就不会对应的值,而是变量名-->
  381. <phase>initialize</phase>
  382. <goals>
  383. <goal>run</goal>
  384. </goals>
  385. <configuration>
  386. <tasks>
  387. <echo message="写入 git 版本信息"/>
  388. <!-- concat 常用于把一些信息写入文件,我这里用于把 git-commit-id-plugin 生成的git环境变量写入文件 -->
  389. <concat destfile="src/main/resources/git.properties">
  390. repo=${git.remote.origin.url}
  391. branch=${git.branch}
  392. commitId=${git.commit.id.abbrev}
  393. commitTime=${git.commit.time}
  394. buildTime=${git.build.time}
  395. </concat>
  396. </tasks>
  397. </configuration>
  398. </execution>
  399. </executions>
  400. </plugin>
  401. </plugins>
  402. </build>
  403. </project>