pom.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ Copyright (c) 2020 pig4cloud Authors. All Rights Reserved.
  4. ~
  5. ~ Licensed under the Apache License, Version 2.0 (the "License");
  6. ~ you may not use this file except in compliance with the License.
  7. ~ You may obtain a copy of the License at
  8. ~
  9. ~ http://www.apache.org/licenses/LICENSE-2.0
  10. ~
  11. ~ Unless required by applicable law or agreed to in writing, software
  12. ~ distributed under the License is distributed on an "AS IS" BASIS,
  13. ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ~ See the License for the specific language governing permissions and
  15. ~ limitations under the License.
  16. -->
  17. <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
  18. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  19. <modelVersion>4.0.0</modelVersion>
  20. <groupId>com.pig4cloud</groupId>
  21. <artifactId>pig</artifactId>
  22. <name>${project.artifactId}</name>
  23. <version>${revision}</version>
  24. <packaging>pom</packaging>
  25. <url>https://www.pig4cloud.com</url>
  26. <properties>
  27. <!-- 项目版本号 -->
  28. <revision>3.9.0</revision>
  29. <spring-boot.version>3.5.3</spring-boot.version>
  30. <spring-cloud.version>2025.0.0</spring-cloud.version>
  31. <spring-cloud-alibaba.version>2023.0.3.3</spring-cloud-alibaba.version>
  32. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  33. <maven.compiler.source>17</maven.compiler.source>
  34. <maven.compiler.target>17</maven.compiler.target>
  35. <spring-boot-admin.version>3.5.0</spring-boot-admin.version>
  36. <screw.version>0.0.3</screw.version>
  37. <captcha.version>2.2.5</captcha.version>
  38. <aws.version>2.29.45</aws.version>
  39. <velocity.version>2.4</velocity.version>
  40. <velocity.tool.version>3.1</velocity.tool.version>
  41. <configuration.version>1.10</configuration.version>
  42. <jasypt.version>3.0.5</jasypt.version>
  43. <jaxb.version>4.0.5</jaxb.version>
  44. <knife4j.version>3.0.5</knife4j.version>
  45. <swagger.fox.version>3.0.0</swagger.fox.version>
  46. <docker.plugin.version>0.45.1</docker.plugin.version>
  47. <docker.host>http://192.168.0.100:2375</docker.host>
  48. <docker.registry>registry.cn-shanghai.aliyuncs.com</docker.registry>
  49. <docker.namespace>pig4cloud</docker.namespace>
  50. <docker.username>username</docker.username>
  51. <docker.password>password</docker.password>
  52. <git.commit.plugin>9.0.1</git.commit.plugin>
  53. <spring.checkstyle.plugin>0.0.43</spring.checkstyle.plugin>
  54. <flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version>
  55. <maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
  56. </properties>
  57. <!-- 以下依赖 全局所有的模块都会引入 -->
  58. <dependencies>
  59. <!--配置文件处理器-->
  60. <dependency>
  61. <groupId>org.springframework.boot</groupId>
  62. <artifactId>spring-boot-configuration-processor</artifactId>
  63. <optional>true</optional>
  64. </dependency>
  65. <!--配置文件加解密-->
  66. <dependency>
  67. <groupId>com.github.ulisesbocchio</groupId>
  68. <artifactId>jasypt-spring-boot-starter</artifactId>
  69. <version>${jasypt.version}</version>
  70. </dependency>
  71. <!--监控-->
  72. <dependency>
  73. <groupId>org.springframework.boot</groupId>
  74. <artifactId>spring-boot-starter-actuator</artifactId>
  75. </dependency>
  76. <!--监控客户端-->
  77. <dependency>
  78. <groupId>de.codecentric</groupId>
  79. <artifactId>spring-boot-admin-starter-client</artifactId>
  80. <version>${spring-boot-admin.version}</version>
  81. </dependency>
  82. <!--Lombok-->
  83. <dependency>
  84. <groupId>org.projectlombok</groupId>
  85. <artifactId>lombok</artifactId>
  86. <scope>provided</scope>
  87. </dependency>
  88. <!-- JAVA 17 -->
  89. <dependency>
  90. <groupId>com.sun.xml.bind</groupId>
  91. <artifactId>jaxb-impl</artifactId>
  92. <version>${jaxb.version}</version>
  93. </dependency>
  94. <!--测试依赖-->
  95. <dependency>
  96. <groupId>org.springframework.boot</groupId>
  97. <artifactId>spring-boot-starter-test</artifactId>
  98. <scope>test</scope>
  99. </dependency>
  100. </dependencies>
  101. <modules>
  102. <module>pig-gateway</module>
  103. <module>pig-auth</module>
  104. <module>pig-upms</module>
  105. <module>pig-common</module>
  106. <module>pig-visual</module>
  107. <module>pig-marketing</module>
  108. <module>pig-statistics</module>
  109. </modules>
  110. <dependencyManagement>
  111. <dependencies>
  112. <!--pig 公共版本定义-->
  113. <dependency>
  114. <groupId>com.pig4cloud</groupId>
  115. <artifactId>pig-common-bom</artifactId>
  116. <version>${project.version}</version>
  117. <type>pom</type>
  118. <scope>import</scope>
  119. </dependency>
  120. <!-- spring boot 依赖 -->
  121. <dependency>
  122. <groupId>org.springframework.boot</groupId>
  123. <artifactId>spring-boot-dependencies</artifactId>
  124. <version>${spring-boot.version}</version>
  125. <type>pom</type>
  126. <scope>import</scope>
  127. </dependency>
  128. <!-- spring cloud 依赖 -->
  129. <dependency>
  130. <groupId>org.springframework.cloud</groupId>
  131. <artifactId>spring-cloud-dependencies</artifactId>
  132. <version>${spring-cloud.version}</version>
  133. <type>pom</type>
  134. <scope>import</scope>
  135. </dependency>
  136. <!-- spring cloud alibaba 依赖 -->
  137. <dependency>
  138. <groupId>com.alibaba.cloud</groupId>
  139. <artifactId>spring-cloud-alibaba-dependencies</artifactId>
  140. <version>${spring-cloud-alibaba.version}</version>
  141. <type>pom</type>
  142. <scope>import</scope>
  143. </dependency>
  144. <!-- 排除 spring cloud alibaba 令人头疼的日志封装-->
  145. <dependency>
  146. <groupId>com.alibaba.cloud</groupId>
  147. <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
  148. <version>${spring-cloud-alibaba.version}</version>
  149. <exclusions>
  150. <exclusion>
  151. <artifactId>logback-adapter</artifactId>
  152. <groupId>com.alibaba.nacos</groupId>
  153. </exclusion>
  154. </exclusions>
  155. </dependency>
  156. </dependencies>
  157. </dependencyManagement>
  158. <build>
  159. <finalName>${project.name}</finalName>
  160. <resources>
  161. <resource>
  162. <directory>src/main/resources</directory>
  163. <filtering>true</filtering>
  164. </resource>
  165. </resources>
  166. <pluginManagement>
  167. <plugins>
  168. <plugin>
  169. <groupId>org.springframework.boot</groupId>
  170. <artifactId>spring-boot-maven-plugin</artifactId>
  171. <version>${spring-boot.version}</version>
  172. <configuration>
  173. <finalName>${project.build.finalName}</finalName>
  174. <layers>
  175. <enabled>true</enabled>
  176. </layers>
  177. </configuration>
  178. <executions>
  179. <execution>
  180. <goals>
  181. <goal>repackage</goal>
  182. </goals>
  183. </execution>
  184. </executions>
  185. </plugin>
  186. <plugin>
  187. <groupId>io.fabric8</groupId>
  188. <artifactId>docker-maven-plugin</artifactId>
  189. <version>${docker.plugin.version}</version>
  190. <configuration>
  191. <!-- Docker Remote Api-->
  192. <dockerHost>${docker.host}</dockerHost>
  193. <!-- Docker 镜像私服-->
  194. <registry>${docker.registry}</registry>
  195. <!-- 认证信息-->
  196. <authConfig>
  197. <push>
  198. <username>${docker.username}</username>
  199. <password>${docker.password}</password>
  200. </push>
  201. </authConfig>
  202. <images>
  203. <image>
  204. <!-- 镜像名称: 172.17.0.111/library/pig-gateway:2.6.3-->
  205. <name>${docker.registry}/${docker.namespace}/${project.name}:${project.version}</name>
  206. <build>
  207. <dockerFile>${project.basedir}/Dockerfile</dockerFile>
  208. </build>
  209. </image>
  210. </images>
  211. </configuration>
  212. </plugin>
  213. </plugins>
  214. </pluginManagement>
  215. <plugins>
  216. <!-- 统一 revision 版本 -->
  217. <plugin>
  218. <groupId>org.codehaus.mojo</groupId>
  219. <artifactId>flatten-maven-plugin</artifactId>
  220. <version>${flatten-maven-plugin.version}</version>
  221. <configuration>
  222. <flattenMode>resolveCiFriendliesOnly</flattenMode>
  223. <updatePomFile>true</updatePomFile>
  224. </configuration>
  225. <executions>
  226. <execution>
  227. <id>flatten</id>
  228. <phase>process-resources</phase>
  229. <goals>
  230. <goal>flatten</goal>
  231. </goals>
  232. </execution>
  233. <execution>
  234. <id>flatten.clean</id>
  235. <phase>clean</phase>
  236. <goals>
  237. <goal>clean</goal>
  238. </goals>
  239. </execution>
  240. </executions>
  241. </plugin>
  242. <plugin>
  243. <groupId>org.apache.maven.plugins</groupId>
  244. <artifactId>maven-compiler-plugin</artifactId>
  245. <version>${maven-compiler-plugin.version}</version>
  246. <configuration>
  247. <target>${maven.compiler.target}</target>
  248. <source>${maven.compiler.source}</source>
  249. <encoding>UTF-8</encoding>
  250. <parameters>true</parameters>
  251. </configuration>
  252. </plugin>
  253. <!--打包jar 与git commit 关联插件-->
  254. <plugin>
  255. <groupId>io.github.git-commit-id</groupId>
  256. <artifactId>git-commit-id-maven-plugin</artifactId>
  257. <version>${git.commit.plugin}</version>
  258. <executions>
  259. <execution>
  260. <id>get-the-git-infos</id>
  261. <phase>initialize</phase>
  262. </execution>
  263. </executions>
  264. <configuration>
  265. <failOnNoGitDirectory>false</failOnNoGitDirectory>
  266. <generateGitPropertiesFile>true</generateGitPropertiesFile>
  267. <!--因为项目定制了jackson的日期时间序列化/反序列化格式,因此这里要进行配置,不然通过management.info.git.mode=full进行完整git信息监控时会存在问题-->
  268. <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
  269. <includeOnlyProperties>
  270. <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
  271. <includeOnlyProperty>^git.commit.(id|message|time).*$</includeOnlyProperty>
  272. </includeOnlyProperties>
  273. </configuration>
  274. </plugin>
  275. <!--
  276. 代码格式插件,默认使用spring 规则,可运行命令进行项目格式化:./mvnw spring-javaformat:apply 或 mvn spring-javaformat:apply,可在IDEA中安装插件以下插件进行自动格式化:
  277. https://repo1.maven.org/maven2/io/spring/javaformat/spring-javaformat-intellij-idea-plugin
  278. -->
  279. <plugin>
  280. <groupId>io.spring.javaformat</groupId>
  281. <artifactId>spring-javaformat-maven-plugin</artifactId>
  282. <version>${spring.checkstyle.plugin}</version>
  283. <executions>
  284. <execution>
  285. <phase>validate</phase>
  286. <inherited>true</inherited>
  287. </execution>
  288. </executions>
  289. </plugin>
  290. </plugins>
  291. </build>
  292. <profiles>
  293. <profile>
  294. <id>cloud</id>
  295. <properties>
  296. <!-- 环境标识,需要与配置文件的名称相对应 -->
  297. <profiles.active>dev</profiles.active>
  298. <nacos.address>http://127.0.0.1:8848</nacos.address>
  299. <nacos.namespace>${profiles.active}</nacos.namespace>
  300. <nacos.username>nacos</nacos.username>
  301. <nacos.password>nacos</nacos.password>
  302. </properties>
  303. <activation>
  304. <!-- 默认环境 -->
  305. <activeByDefault>true</activeByDefault>
  306. </activation>
  307. </profile>
  308. <profile>
  309. <id>test</id>
  310. <properties>
  311. <!-- 环境标识,需要与配置文件的名称相对应 -->
  312. <profiles.active>test</profiles.active>
  313. <nacos.address>http://192.168.10.101:8848</nacos.address>
  314. <nacos.namespace>${profiles.active}</nacos.namespace>
  315. <nacos.username></nacos.username>
  316. <nacos.password></nacos.password>
  317. </properties>
  318. <activation>
  319. <!-- 默认环境 -->
  320. <activeByDefault>false</activeByDefault>
  321. </activation>
  322. </profile>
  323. </profiles>
  324. </project>