pom.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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. <modelVersion>4.0.0</modelVersion>
  6. <parent>
  7. <groupId>org.springframework.boot</groupId>
  8. <artifactId>spring-boot-starter-parent</artifactId>
  9. <version>2.7.18</version> <!-- 或 3.x,但配置略有不同 -->
  10. <relativePath/>
  11. </parent>
  12. <groupId>org.pay</groupId>
  13. <artifactId>paysupply</artifactId>
  14. <version>1.0</version>
  15. <properties>
  16. <maven.compiler.source>8</maven.compiler.source>
  17. <maven.compiler.target>8</maven.compiler.target>
  18. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  19. <!-- 环境标识 -->
  20. <env>dev</env>
  21. <commons-lang3.version>3.4</commons-lang3.version>
  22. <fastjson.version>2.0.61</fastjson.version>
  23. <httpcomponents-httpclient.version>4.5.14</httpcomponents-httpclient.version>
  24. <mybatis.version>3.2.0</mybatis.version>
  25. <mysql.version>8.0.33</mysql.version>
  26. </properties>
  27. <dependencies>
  28. <!-- Spring Boot Starter -->
  29. <dependency>
  30. <groupId>org.springframework.boot</groupId>
  31. <artifactId>spring-boot-starter-web</artifactId>
  32. <exclusions>
  33. <!-- 排除内嵌 Tomcat,改用 Undertow(允许 URL 中未转义的中文/方括号) -->
  34. <exclusion>
  35. <groupId>org.springframework.boot</groupId>
  36. <artifactId>spring-boot-starter-tomcat</artifactId>
  37. </exclusion>
  38. </exclusions>
  39. </dependency>
  40. <!-- Undertow 容器(替代 Tomcat) -->
  41. <dependency>
  42. <groupId>org.springframework.boot</groupId>
  43. <artifactId>spring-boot-starter-undertow</artifactId>
  44. </dependency>
  45. <!-- Kafka 依赖(关键) -->
  46. <dependency>
  47. <groupId>org.springframework.kafka</groupId>
  48. <artifactId>spring-kafka</artifactId>
  49. </dependency>
  50. <!-- commons -->
  51. <dependency>
  52. <groupId>org.apache.commons</groupId>
  53. <artifactId>commons-lang3</artifactId>
  54. <version>${commons-lang3.version}</version>
  55. </dependency>
  56. <!-- Apache HTTP Client -->
  57. <dependency>
  58. <groupId>org.apache.httpcomponents</groupId>
  59. <artifactId>httpclient</artifactId>
  60. <version>${httpcomponents-httpclient.version}</version>
  61. </dependency>
  62. <!-- lombok -->
  63. <dependency>
  64. <groupId>org.projectlombok</groupId>
  65. <artifactId>lombok</artifactId>
  66. <optional>true</optional>
  67. </dependency>
  68. <!-- json依赖 -->
  69. <dependency>
  70. <groupId>com.alibaba</groupId>
  71. <artifactId>fastjson</artifactId>
  72. <version>${fastjson.version}</version>
  73. </dependency>
  74. <dependency>
  75. <groupId>org.springframework.boot</groupId>
  76. <artifactId>spring-boot-starter-validation</artifactId>
  77. </dependency>
  78. <!-- mongodb -->
  79. <dependency>
  80. <groupId>org.springframework.boot</groupId>
  81. <artifactId>spring-boot-starter-data-mongodb</artifactId>
  82. </dependency>
  83. <!--redis-->
  84. <dependency>
  85. <groupId>org.springframework.boot</groupId>
  86. <artifactId>spring-boot-starter-data-redis</artifactId>
  87. <exclusions>
  88. <!-- 过滤lettuce,使用jedis作为redis客户端 -->
  89. <exclusion>
  90. <groupId>io.lettuce</groupId>
  91. <artifactId>lettuce-core</artifactId>
  92. </exclusion>
  93. </exclusions>
  94. </dependency>
  95. <dependency>
  96. <groupId>redis.clients</groupId>
  97. <artifactId>jedis</artifactId>
  98. </dependency>
  99. <!-- @RefreshScope 核心支持 -->
  100. <dependency>
  101. <groupId>org.springframework.cloud</groupId>
  102. <artifactId>spring-cloud-starter-bootstrap</artifactId>
  103. </dependency>
  104. <!-- spring cloud config -->
  105. <dependency>
  106. <groupId>org.springframework.cloud</groupId>
  107. <artifactId>spring-cloud-starter-config</artifactId>
  108. </dependency>
  109. <!-- mysql -->
  110. <dependency>
  111. <groupId>com.mysql</groupId>
  112. <artifactId>mysql-connector-j</artifactId>
  113. <version>${mysql.version}</version>
  114. <scope>runtime</scope>
  115. </dependency>
  116. <dependency>
  117. <groupId>com.baomidou</groupId>
  118. <artifactId>mybatis-plus-boot-starter</artifactId>
  119. <version>${mybatis.version}</version>
  120. </dependency>
  121. </dependencies>
  122. <!-- BOM 版本管理 -->
  123. <dependencyManagement>
  124. <dependencies>
  125. <dependency>
  126. <groupId>org.springframework.cloud</groupId>
  127. <artifactId>spring-cloud-dependencies</artifactId>
  128. <version>2021.0.9</version>
  129. <type>pom</type>
  130. <scope>import</scope>
  131. </dependency>
  132. </dependencies>
  133. </dependencyManagement>
  134. <!-- 环境配置 -->
  135. <profiles>
  136. <!-- 生产环境 -->
  137. <profile>
  138. <id>pro</id>
  139. <activation>
  140. <activeByDefault>true</activeByDefault>
  141. </activation>
  142. <properties>
  143. <env>pro</env>
  144. <spring.profiles.active>pro</spring.profiles.active>
  145. </properties>
  146. <build>
  147. <finalName>${project.artifactId}-${project.version}-pro</finalName>
  148. </build>
  149. </profile>
  150. </profiles>
  151. <build>
  152. <!-- 资源过滤配置 -->
  153. <resources>
  154. <resource>
  155. <directory>src/main/resources</directory>
  156. <filtering>true</filtering>
  157. <includes>
  158. <include>**/*.properties</include>
  159. <include>**/*.yml</include>
  160. <include>**/*.yaml</include>
  161. <include>**/*.xml</include>
  162. </includes>
  163. </resource>
  164. <resource>
  165. <directory>src/main/resources</directory>
  166. <filtering>false</filtering>
  167. <excludes>
  168. <exclude>**/*.properties</exclude>
  169. <exclude>**/*.yml</exclude>
  170. <exclude>**/*.yaml</exclude>
  171. <exclude>**/*.xml</exclude>
  172. </excludes>
  173. </resource>
  174. </resources>
  175. <plugins>
  176. <plugin>
  177. <groupId>org.springframework.boot</groupId>
  178. <artifactId>spring-boot-maven-plugin</artifactId>
  179. <configuration>
  180. <!-- 激活的Spring Profile -->
  181. <profiles>
  182. <profile>${spring.profiles.active}</profile>
  183. </profiles>
  184. </configuration>
  185. </plugin>
  186. <!-- 资源过滤插件 -->
  187. <plugin>
  188. <groupId>org.apache.maven.plugins</groupId>
  189. <artifactId>maven-resources-plugin</artifactId>
  190. <version>3.2.0</version>
  191. <configuration>
  192. <encoding>UTF-8</encoding>
  193. </configuration>
  194. </plugin>
  195. </plugins>
  196. </build>
  197. </project>