pom.xml 10 KB

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