pom.xml 17 KB

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