pom.xml 17 KB

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