pom.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  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. </modules>
  109. <dependencyManagement>
  110. <dependencies>
  111. <!--pig 公共版本定义-->
  112. <dependency>
  113. <groupId>com.pig4cloud</groupId>
  114. <artifactId>pig-common-bom</artifactId>
  115. <version>${project.version}</version>
  116. <type>pom</type>
  117. <scope>import</scope>
  118. </dependency>
  119. <!-- spring boot 依赖 -->
  120. <dependency>
  121. <groupId>org.springframework.boot</groupId>
  122. <artifactId>spring-boot-dependencies</artifactId>
  123. <version>${spring-boot.version}</version>
  124. <type>pom</type>
  125. <scope>import</scope>
  126. </dependency>
  127. <!-- spring cloud 依赖 -->
  128. <dependency>
  129. <groupId>org.springframework.cloud</groupId>
  130. <artifactId>spring-cloud-dependencies</artifactId>
  131. <version>${spring-cloud.version}</version>
  132. <type>pom</type>
  133. <scope>import</scope>
  134. </dependency>
  135. <!-- spring cloud alibaba 依赖 -->
  136. <dependency>
  137. <groupId>com.alibaba.cloud</groupId>
  138. <artifactId>spring-cloud-alibaba-dependencies</artifactId>
  139. <version>${spring-cloud-alibaba.version}</version>
  140. <type>pom</type>
  141. <scope>import</scope>
  142. </dependency>
  143. <!-- 排除 spring cloud alibaba 令人头疼的日志封装-->
  144. <dependency>
  145. <groupId>com.alibaba.cloud</groupId>
  146. <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
  147. <version>${spring-cloud-alibaba.version}</version>
  148. <exclusions>
  149. <exclusion>
  150. <artifactId>logback-adapter</artifactId>
  151. <groupId>com.alibaba.nacos</groupId>
  152. </exclusion>
  153. </exclusions>
  154. </dependency>
  155. </dependencies>
  156. </dependencyManagement>
  157. <build>
  158. <finalName>${project.name}</finalName>
  159. <resources>
  160. <resource>
  161. <directory>src/main/resources</directory>
  162. <filtering>true</filtering>
  163. </resource>
  164. </resources>
  165. <pluginManagement>
  166. <plugins>
  167. <plugin>
  168. <groupId>org.springframework.boot</groupId>
  169. <artifactId>spring-boot-maven-plugin</artifactId>
  170. <version>${spring-boot.version}</version>
  171. <configuration>
  172. <finalName>${project.build.finalName}</finalName>
  173. <layers>
  174. <enabled>true</enabled>
  175. </layers>
  176. </configuration>
  177. <executions>
  178. <execution>
  179. <goals>
  180. <goal>repackage</goal>
  181. </goals>
  182. </execution>
  183. </executions>
  184. </plugin>
  185. <plugin>
  186. <groupId>io.fabric8</groupId>
  187. <artifactId>docker-maven-plugin</artifactId>
  188. <version>${docker.plugin.version}</version>
  189. <configuration>
  190. <!-- Docker Remote Api-->
  191. <dockerHost>${docker.host}</dockerHost>
  192. <!-- Docker 镜像私服-->
  193. <registry>${docker.registry}</registry>
  194. <!-- 认证信息-->
  195. <authConfig>
  196. <push>
  197. <username>${docker.username}</username>
  198. <password>${docker.password}</password>
  199. </push>
  200. </authConfig>
  201. <images>
  202. <image>
  203. <!-- 镜像名称: 172.17.0.111/library/pig-gateway:2.6.3-->
  204. <name>${docker.registry}/${docker.namespace}/${project.name}:${project.version}</name>
  205. <build>
  206. <dockerFile>${project.basedir}/Dockerfile</dockerFile>
  207. </build>
  208. </image>
  209. </images>
  210. </configuration>
  211. </plugin>
  212. </plugins>
  213. </pluginManagement>
  214. <plugins>
  215. <!-- 统一 revision 版本 -->
  216. <plugin>
  217. <groupId>org.codehaus.mojo</groupId>
  218. <artifactId>flatten-maven-plugin</artifactId>
  219. <version>${flatten-maven-plugin.version}</version>
  220. <configuration>
  221. <flattenMode>resolveCiFriendliesOnly</flattenMode>
  222. <updatePomFile>true</updatePomFile>
  223. </configuration>
  224. <executions>
  225. <execution>
  226. <id>flatten</id>
  227. <phase>process-resources</phase>
  228. <goals>
  229. <goal>flatten</goal>
  230. </goals>
  231. </execution>
  232. <execution>
  233. <id>flatten.clean</id>
  234. <phase>clean</phase>
  235. <goals>
  236. <goal>clean</goal>
  237. </goals>
  238. </execution>
  239. </executions>
  240. </plugin>
  241. <plugin>
  242. <groupId>org.apache.maven.plugins</groupId>
  243. <artifactId>maven-compiler-plugin</artifactId>
  244. <version>${maven-compiler-plugin.version}</version>
  245. <configuration>
  246. <target>${maven.compiler.target}</target>
  247. <source>${maven.compiler.source}</source>
  248. <encoding>UTF-8</encoding>
  249. <parameters>true</parameters>
  250. </configuration>
  251. </plugin>
  252. <!--打包jar 与git commit 关联插件-->
  253. <plugin>
  254. <groupId>io.github.git-commit-id</groupId>
  255. <artifactId>git-commit-id-maven-plugin</artifactId>
  256. <version>${git.commit.plugin}</version>
  257. <executions>
  258. <execution>
  259. <id>get-the-git-infos</id>
  260. <phase>initialize</phase>
  261. </execution>
  262. </executions>
  263. <configuration>
  264. <failOnNoGitDirectory>false</failOnNoGitDirectory>
  265. <generateGitPropertiesFile>true</generateGitPropertiesFile>
  266. <!--因为项目定制了jackson的日期时间序列化/反序列化格式,因此这里要进行配置,不然通过management.info.git.mode=full进行完整git信息监控时会存在问题-->
  267. <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
  268. <includeOnlyProperties>
  269. <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
  270. <includeOnlyProperty>^git.commit.(id|message|time).*$</includeOnlyProperty>
  271. </includeOnlyProperties>
  272. </configuration>
  273. </plugin>
  274. <!--
  275. 代码格式插件,默认使用spring 规则,可运行命令进行项目格式化:./mvnw spring-javaformat:apply 或 mvn spring-javaformat:apply,可在IDEA中安装插件以下插件进行自动格式化:
  276. https://repo1.maven.org/maven2/io/spring/javaformat/spring-javaformat-intellij-idea-plugin
  277. -->
  278. <plugin>
  279. <groupId>io.spring.javaformat</groupId>
  280. <artifactId>spring-javaformat-maven-plugin</artifactId>
  281. <version>${spring.checkstyle.plugin}</version>
  282. <executions>
  283. <execution>
  284. <phase>validate</phase>
  285. <inherited>true</inherited>
  286. </execution>
  287. </executions>
  288. </plugin>
  289. </plugins>
  290. </build>
  291. <profiles>
  292. <profile>
  293. <id>cloud</id>
  294. <properties>
  295. <!-- 环境标识,需要与配置文件的名称相对应 -->
  296. <profiles.active>dev</profiles.active>
  297. <nacos.address>http://127.0.0.1:8848</nacos.address>
  298. <nacos.namespace>${profiles.active}</nacos.namespace>
  299. <nacos.username>nacos</nacos.username>
  300. <nacos.password>nacos</nacos.password>
  301. </properties>
  302. <activation>
  303. <!-- 默认环境 -->
  304. <activeByDefault>true</activeByDefault>
  305. </activation>
  306. </profile>
  307. <profile>
  308. <id>test</id>
  309. <properties>
  310. <!-- 环境标识,需要与配置文件的名称相对应 -->
  311. <profiles.active>test</profiles.active>
  312. <nacos.address>http://192.168.10.101:8848</nacos.address>
  313. <nacos.namespace>${profiles.active}</nacos.namespace>
  314. <nacos.username></nacos.username>
  315. <nacos.password></nacos.password>
  316. </properties>
  317. <activation>
  318. <!-- 默认环境 -->
  319. <activeByDefault>false</activeByDefault>
  320. </activation>
  321. </profile>
  322. </profiles>
  323. </project>