pom.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. <groupId>com.xindazhou</groupId>
  7. <artifactId>xdz-server</artifactId>
  8. <version>${revision}</version>
  9. <packaging>pom</packaging>
  10. <name>${project.artifactId}</name>
  11. <description>新大洲车联网CRM系统服务端架构</description>
  12. <modules>
  13. <!-- 基础模块 -->
  14. <module>xdz-dependencies</module>
  15. <module>xdz-framework</module>
  16. <!-- 业务服务模块 -->
  17. <module>xdz-module-gateway</module>
  18. <module>xdz-module-user</module>
  19. <module>xdz-module-vehicle</module>
  20. <module>xdz-module-message</module>
  21. <module>xdz-module-business</module>
  22. <module>xdz-module-platform</module>
  23. </modules>
  24. <properties>
  25. <revision>1.0.0-SNAPSHOT</revision>
  26. <!-- Maven 相关 -->
  27. <java.version>17</java.version>
  28. <maven.compiler.source>${java.version}</maven.compiler.source>
  29. <maven.compiler.target>${java.version}</maven.compiler.target>
  30. <maven-surefire-plugin.version>3.5.3</maven-surefire-plugin.version>
  31. <maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
  32. <flatten-maven-plugin.version>1.7.2</flatten-maven-plugin.version>
  33. <!-- maven-surefire-plugin 暂时无法通过 bom 的依赖读取(兼容老版本 IDEA 2024 及以前版本) -->
  34. <lombok.version>1.18.42</lombok.version>
  35. <spring.boot.version>3.5.9</spring.boot.version>
  36. <mapstruct.version>1.6.3</mapstruct.version>
  37. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  38. </properties>
  39. <dependencyManagement>
  40. <dependencies>
  41. <!-- 注意:xdz-dependencies 需要先编译安装才能被引用 -->
  42. <!-- 如果报错,请先执行: mvn clean install -pl xdz-dependencies -am -->
  43. <dependency>
  44. <groupId>com.xindazhou</groupId>
  45. <artifactId>xdz-dependencies</artifactId>
  46. <version>${revision}</version>
  47. <type>pom</type>
  48. <scope>import</scope>
  49. </dependency>
  50. </dependencies>
  51. </dependencyManagement>
  52. <build>
  53. <pluginManagement>
  54. <plugins>
  55. <!-- maven-surefire-plugin 插件,用于运行单元测试。 -->
  56. <!-- 注意,需要使用 3.0.X+,因为要支持 Junit 5 版本 -->
  57. <plugin>
  58. <groupId>org.apache.maven.plugins</groupId>
  59. <artifactId>maven-surefire-plugin</artifactId>
  60. <version>${maven-surefire-plugin.version}</version>
  61. </plugin>
  62. <!-- maven-compiler-plugin 插件,解决 Lombok + MapStruct 组合 -->
  63. <!-- https://stackoverflow.com/questions/33483697/re-run-spring-boot-configuration-annotation-processor-to-update-generated-metada -->
  64. <plugin>
  65. <groupId>org.apache.maven.plugins</groupId>
  66. <artifactId>maven-compiler-plugin</artifactId>
  67. <version>${maven-compiler-plugin.version}</version>
  68. <configuration>
  69. <source>${java.version}</source>
  70. <target>${java.version}</target>
  71. <annotationProcessorPaths>
  72. <path>
  73. <groupId>org.springframework.boot</groupId>
  74. <artifactId>spring-boot-configuration-processor</artifactId>
  75. <version>${spring.boot.version}</version>
  76. </path>
  77. <path>
  78. <groupId>org.projectlombok</groupId>
  79. <artifactId>lombok</artifactId>
  80. <version>${lombok.version}</version>
  81. </path>
  82. <path>
  83. <!-- 确保 Lombok 生成的 getter/setter 方法能被 MapStruct 正确识别,
  84. 避免出现 No property named "xxx" exists 的编译错误 -->
  85. <groupId>org.projectlombok</groupId>
  86. <artifactId>lombok-mapstruct-binding</artifactId>
  87. <version>0.2.0</version>
  88. </path>
  89. <path>
  90. <groupId>org.mapstruct</groupId>
  91. <artifactId>mapstruct-processor</artifactId>
  92. <version>${mapstruct.version}</version>
  93. </path>
  94. </annotationProcessorPaths>
  95. <!-- 编译参数写在 arg 内,解决 Spring Boot 3.2 的 Parameter Name Discovery 问题 -->
  96. <debug>false</debug>
  97. <compilerArgs>
  98. <arg>-parameters</arg>
  99. </compilerArgs>
  100. </configuration>
  101. </plugin>
  102. </plugins>
  103. </pluginManagement>
  104. <plugins>
  105. <!-- 统一 revision 版本 -->
  106. <plugin>
  107. <groupId>org.codehaus.mojo</groupId>
  108. <artifactId>flatten-maven-plugin</artifactId>
  109. <version>${flatten-maven-plugin.version}</version>
  110. <configuration>
  111. <flattenMode>oss</flattenMode>
  112. <updatePomFile>true</updatePomFile>
  113. </configuration>
  114. <executions>
  115. <execution>
  116. <goals>
  117. <goal>flatten</goal>
  118. </goals>
  119. <id>flatten</id>
  120. <phase>process-resources</phase>
  121. </execution>
  122. <execution>
  123. <goals>
  124. <goal>clean</goal>
  125. </goals>
  126. <id>flatten.clean</id>
  127. <phase>clean</phase>
  128. </execution>
  129. </executions>
  130. </plugin>
  131. </plugins>
  132. </build>
  133. <!-- 使用 huawei / aliyun 的 Maven 源,提升下载速度 -->
  134. <repositories>
  135. <repository>
  136. <id>huaweicloud</id>
  137. <name>huawei</name>
  138. <url>https://mirrors.huaweicloud.com/repository/maven/</url>
  139. </repository>
  140. <repository>
  141. <id>aliyunmaven</id>
  142. <name>aliyun</name>
  143. <url>https://maven.aliyun.com/repository/public</url>
  144. </repository>
  145. <repository>
  146. <id>spring-milestones</id>
  147. <name>Spring Milestones</name>
  148. <url>https://repo.spring.io/milestone</url>
  149. <snapshots>
  150. <enabled>false</enabled>
  151. </snapshots>
  152. </repository>
  153. <repository>
  154. <id>spring-snapshots</id>
  155. <name>Spring Snapshots</name>
  156. <url>https://repo.spring.io/snapshot</url>
  157. <releases>
  158. <enabled>false</enabled>
  159. </releases>
  160. </repository>
  161. </repositories>
  162. </project>