pom.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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>devops</artifactId>
  7. <groupId>cn.reghao.devops</groupId>
  8. <version>1.0.0</version>
  9. </parent>
  10. <modelVersion>4.0.0</modelVersion>
  11. <artifactId>manager</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. </properties>
  21. <dependencyManagement>
  22. <dependencies>
  23. <dependency>
  24. <groupId>org.springframework.boot</groupId>
  25. <artifactId>spring-boot-dependencies</artifactId>
  26. <version>2.3.9.RELEASE</version>
  27. <type>pom</type>
  28. <scope>import</scope>
  29. </dependency>
  30. </dependencies>
  31. </dependencyManagement>
  32. <dependencies>
  33. <dependency>
  34. <groupId>cn.reghao.jutil</groupId>
  35. <artifactId>web</artifactId>
  36. <version>1.0.0-SNAPSHOT</version>
  37. </dependency>
  38. <dependency>
  39. <groupId>cn.reghao.devops</groupId>
  40. <artifactId>common</artifactId>
  41. <version>1.0.0-SNAPSHOT</version>
  42. </dependency>
  43. <dependency>
  44. <groupId>cn.reghao.devops</groupId>
  45. <artifactId>model</artifactId>
  46. <version>1.0.0-SNAPSHOT</version>
  47. </dependency>
  48. <dependency>
  49. <groupId>org.springframework.boot</groupId>
  50. <artifactId>spring-boot-starter</artifactId>
  51. </dependency>
  52. <dependency>
  53. <groupId>org.springframework.boot</groupId>
  54. <artifactId>spring-boot-starter-test</artifactId>
  55. <scope>test</scope>
  56. </dependency>
  57. <dependency>
  58. <groupId>org.springframework.boot</groupId>
  59. <artifactId>spring-boot-starter-web</artifactId>
  60. </dependency>
  61. <dependency>
  62. <groupId>org.springframework.boot</groupId>
  63. <artifactId>spring-boot-starter-websocket</artifactId>
  64. </dependency>
  65. <dependency>
  66. <groupId>org.springframework.boot</groupId>
  67. <artifactId>spring-boot-configuration-processor</artifactId>
  68. <optional>true</optional>
  69. </dependency>
  70. <dependency>
  71. <groupId>org.springframework.boot</groupId>
  72. <artifactId>spring-boot-starter-validation</artifactId>
  73. </dependency>
  74. <dependency>
  75. <groupId>javax.validation</groupId>
  76. <artifactId>validation-api</artifactId>
  77. <version>2.0.1.Final</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>mysql</groupId>
  85. <artifactId>mysql-connector-java</artifactId>
  86. <version>8.0.17</version>
  87. </dependency>
  88. <dependency>
  89. <groupId>com.zaxxer</groupId>
  90. <artifactId>HikariCP</artifactId>
  91. <version>3.3.1</version>
  92. </dependency>
  93. <dependency>
  94. <groupId>org.springframework.boot</groupId>
  95. <artifactId>spring-boot-starter-security</artifactId>
  96. </dependency>
  97. <dependency>
  98. <groupId>org.springframework.boot</groupId>
  99. <artifactId>spring-boot-starter-thymeleaf</artifactId>
  100. </dependency>
  101. <dependency>
  102. <groupId>org.thymeleaf.extras</groupId>
  103. <artifactId>thymeleaf-extras-springsecurity5</artifactId>
  104. </dependency>
  105. <dependency>
  106. <groupId>org.springframework.boot</groupId>
  107. <artifactId>spring-boot-starter-cache</artifactId>
  108. </dependency>
  109. <dependency>
  110. <groupId>com.github.ben-manes.caffeine</groupId>
  111. <artifactId>caffeine</artifactId>
  112. </dependency>
  113. <dependency>
  114. <groupId>io.springfox</groupId>
  115. <artifactId>springfox-swagger2</artifactId>
  116. <version>2.9.2</version>
  117. </dependency>
  118. <dependency>
  119. <groupId>io.springfox</groupId>
  120. <artifactId>springfox-swagger-ui</artifactId>
  121. <version>2.9.2</version>
  122. </dependency>
  123. <dependency>
  124. <groupId>org.eclipse.jgit</groupId>
  125. <artifactId>org.eclipse.jgit</artifactId>
  126. <version>6.4.0.202211300538-r</version>
  127. </dependency>
  128. <dependency>
  129. <groupId>org.eclipse.jgit</groupId>
  130. <artifactId>org.eclipse.jgit.ssh.apache</artifactId>
  131. <version>6.4.0.202211300538-r</version>
  132. </dependency>
  133. <dependency>
  134. <groupId>org.apache.maven</groupId>
  135. <artifactId>maven-model</artifactId>
  136. <version>3.6.0</version>
  137. </dependency>
  138. <dependency>
  139. <groupId>org.apache.maven.shared</groupId>
  140. <artifactId>maven-invoker</artifactId>
  141. <version>3.0.1</version>
  142. </dependency>
  143. <dependency>
  144. <groupId>com.jcraft</groupId>
  145. <artifactId>jsch</artifactId>
  146. <version>0.1.55</version>
  147. </dependency>
  148. <dependency>
  149. <groupId>com.sun.mail</groupId>
  150. <artifactId>javax.mail</artifactId>
  151. <version>1.6.2</version>
  152. </dependency>
  153. <dependency>
  154. <groupId>commons-io</groupId>
  155. <artifactId>commons-io</artifactId>
  156. <version>2.6</version>
  157. </dependency>
  158. <!--<dependency>
  159. <groupId>org.apache.dubbo</groupId>
  160. <artifactId>dubbo-spring-boot-starter</artifactId>
  161. <version>2.7.8</version>
  162. </dependency>
  163. <dependency>
  164. <groupId>org.apache.curator</groupId>
  165. <artifactId>curator-recipes</artifactId>
  166. <version>2.12.0</version>
  167. </dependency>
  168. <dependency>
  169. <groupId>cn.reghao.tnb.account</groupId>
  170. <artifactId>account-api</artifactId>
  171. <version>1.0.0-SNAPSHOT</version>
  172. </dependency>
  173. <dependency>
  174. <groupId>cn.reghao.tnb.content</groupId>
  175. <artifactId>content-api</artifactId>
  176. <version>1.0.0-SNAPSHOT</version>
  177. </dependency>-->
  178. </dependencies>
  179. <profiles>
  180. <profile>
  181. <id>dev</id>
  182. <properties>
  183. <profile.active>dev</profile.active>
  184. </properties>
  185. <activation>
  186. <activeByDefault>true</activeByDefault>
  187. </activation>
  188. </profile>
  189. <profile>
  190. <id>test</id>
  191. <properties>
  192. <profile.active>test</profile.active>
  193. </properties>
  194. </profile>
  195. </profiles>
  196. <build>
  197. <finalName>devops-${project.artifactId}</finalName>
  198. <resources>
  199. <resource>
  200. <directory>src/main/resources</directory>
  201. <filtering>true</filtering>
  202. <includes>
  203. <include>application.yml</include>
  204. <include>application-${profile.active}.yml</include>
  205. <include>logback-spring.xml</include>
  206. <include>git.properties</include>
  207. <!-- 前端静态资源 -->
  208. <include>static/**</include>
  209. <include>templates/**</include>
  210. </includes>
  211. </resource>
  212. </resources>
  213. <plugins>
  214. <plugin>
  215. <groupId>org.apache.maven.plugins</groupId>
  216. <artifactId>maven-compiler-plugin</artifactId>
  217. <version>3.8.1</version>
  218. <configuration>
  219. <source>11</source>
  220. <target>11</target>
  221. </configuration>
  222. </plugin>
  223. <plugin>
  224. <groupId>org.apache.maven.plugins</groupId>
  225. <artifactId>maven-resources-plugin</artifactId>
  226. <version>2.4.3</version>
  227. <configuration>
  228. <!-- 让 maven 不处理字体 -->
  229. <nonFilteredFileExtensions>
  230. <nonFilteredFileExtension>ttf</nonFilteredFileExtension>
  231. <nonFilteredFileExtension>woff</nonFilteredFileExtension>
  232. <nonFilteredFileExtension>woff2</nonFilteredFileExtension>
  233. </nonFilteredFileExtensions>
  234. </configuration>
  235. </plugin>
  236. <plugin>
  237. <groupId>org.springframework.boot</groupId>
  238. <artifactId>spring-boot-maven-plugin</artifactId>
  239. <version>2.3.9.RELEASE</version>
  240. <executions>
  241. <execution>
  242. <goals>
  243. <goal>repackage</goal>
  244. </goals>
  245. </execution>
  246. </executions>
  247. <configuration>
  248. <!-- 生成的 jar 包输出到指定目录 -->
  249. <outputDirectory>${project.build.outputDir}</outputDirectory>
  250. </configuration>
  251. </plugin>
  252. <!--git-commit-id-plugin 插件,用于实现打包带git版本信息-->
  253. <plugin>
  254. <groupId>pl.project13.maven</groupId>
  255. <artifactId>git-commit-id-plugin</artifactId>
  256. <version>2.1.5</version>
  257. <executions>
  258. <execution>
  259. <goals>
  260. <goal>revision</goal>
  261. </goals>
  262. </execution>
  263. </executions>
  264. <configuration>
  265. <!--日期格式;默认值:dd.MM.yyyy '@' HH:mm:ss z;-->
  266. <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
  267. <!--,构建过程中,是否打印详细信息;默认值:false;-->
  268. <verbose>true</verbose>
  269. <!-- ".git"文件路径;默认值:${project.basedir}/.git;
  270. 注意: 如果是多模块(多模块)项目,则需要修改到.git文件夹的目录-->
  271. <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
  272. <!--若项目打包类型为pom,是否取消构建;默认值:true;-->
  273. <skipPoms>false</skipPoms>
  274. <!--是否生成"git.properties"文件;默认值:false;-->
  275. <generateGitPropertiesFile>true</generateGitPropertiesFile>
  276. <!--指定"git.properties"文件的存放路径(相对于${project.basedir}的一个路径);
  277. 注意:该地址决定接口代码是否可以读取到git版本信息,请自行修改-->
  278. <generateGitPropertiesFilename>src/main/resources/git.properties</generateGitPropertiesFilename>
  279. <!--".git"文件夹未找到时,构建是否失败;若设置true,则构建失败;若设置false,则跳过执行该目标;默认值:true;-->
  280. <failOnNoGitDirectory>true</failOnNoGitDirectory>
  281. <!--git描述配置,可选;由JGit提供实现;-->
  282. <gitDescribe>
  283. <!--是否生成描述属性-->
  284. <skip>false</skip>
  285. <!--提交操作未发现tag时,仅打印提交操作ID,-->
  286. <always>false</always>
  287. <!--提交操作ID显式字符长度,最大值为:40;默认值:7;
  288. 0代表特殊意义;后面有解释;
  289. -->
  290. <abbrev>8</abbrev>
  291. <!--构建触发时,代码有修改时(即"dirty state"),添加指定后缀;默认值:"";-->
  292. <dirty>-dirty</dirty>
  293. <!--always print using the "tag-commits_from_tag-g_commit_id-maybe_dirty" format, even if "on" a tag.
  294. The distance will always be 0 if you're "on" the tag.
  295. -->
  296. <forceLongFormat>false</forceLongFormat>
  297. </gitDescribe>
  298. </configuration>
  299. </plugin>
  300. <!--apache maven插件,用于执行ant脚本函数-->
  301. <plugin>
  302. <groupId>org.apache.maven.plugins</groupId>
  303. <artifactId>maven-antrun-plugin</artifactId>
  304. <version>1.8</version>
  305. <executions>
  306. <execution>
  307. <!--maven 插件生命周期,我试过用compile 发现打包以后没有git.properties,因为打包的时候,还没有生成
  308. 注意,这里改成 initialize 的话, 上面 git-commit-id-plugin 插件对应也该添加 phase 配置,并设置为 initialize
  309. 否则你生成的文件,写入的就不会对应的值,而是变量名-->
  310. <phase>initialize</phase>
  311. <goals>
  312. <goal>run</goal>
  313. </goals>
  314. <configuration>
  315. <tasks>
  316. <echo message="写入 git 版本信息"/>
  317. <!-- concat 常用于把一些信息写入文件,我这里用于把 git-commit-id-plugin 生成的git环境变量写入文件 -->
  318. <concat destfile="src/main/resources/git.properties">
  319. repo=${git.remote.origin.url}
  320. branch=${git.branch}
  321. commitId=${git.commit.id.abbrev}
  322. commitTime=${git.commit.time}
  323. buildTime=${git.build.time}
  324. </concat>
  325. </tasks>
  326. </configuration>
  327. </execution>
  328. </executions>
  329. </plugin>
  330. </plugins>
  331. </build>
  332. </project>