pom.xml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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>cn.sikey.cloud</groupId>
  7. <artifactId>sikey</artifactId>
  8. <version>${revision}</version>
  9. <packaging>pom</packaging>
  10. <modules>
  11. <module>sikey-dependencies</module>
  12. <module>sikey-framework</module>
  13. </modules>
  14. <name>${project.artifactId}</name>
  15. <description>sikey项目基础脚手架</description>
  16. <properties>
  17. <revision>2.3.0-SNAPSHOT</revision>
  18. <!-- Maven 相关 -->
  19. <java.version>23</java.version>
  20. <maven.compiler.source>${java.version}</maven.compiler.source>
  21. <maven.compiler.target>${java.version}</maven.compiler.target>
  22. <maven-surefire-plugin.version>3.2.2</maven-surefire-plugin.version>
  23. <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
  24. <flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version>
  25. <!-- 看看咋放到 bom 里 -->
  26. <lombok.version>1.18.36</lombok.version>
  27. <spring.boot.version>3.4.0</spring.boot.version>
  28. <mapstruct.version>1.6.2</mapstruct.version>
  29. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  30. <jackson.version>2.17.2</jackson.version>
  31. </properties>
  32. <dependencyManagement>
  33. <dependencies>
  34. <dependency>
  35. <groupId>cn.sikey.cloud</groupId>
  36. <artifactId>sikey-dependencies</artifactId>
  37. <version>${revision}</version>
  38. <type>pom</type>
  39. <scope>import</scope>
  40. </dependency>
  41. </dependencies>
  42. </dependencyManagement>
  43. <build>
  44. <pluginManagement>
  45. <plugins>
  46. <!-- maven-surefire-plugin 插件,用于运行单元测试。 -->
  47. <!-- 注意,需要使用 3.0.X+,因为要支持 Junit 5 版本 -->
  48. <plugin>
  49. <groupId>org.apache.maven.plugins</groupId>
  50. <artifactId>maven-surefire-plugin</artifactId>
  51. <version>${maven-surefire-plugin.version}</version>
  52. </plugin>
  53. <!-- maven-compiler-plugin 插件,解决 Lombok + MapStruct 组合 -->
  54. <!-- https://stackoverflow.com/questions/33483697/re-run-spring-boot-configuration-annotation-processor-to-update-generated-metada -->
  55. <plugin>
  56. <groupId>org.apache.maven.plugins</groupId>
  57. <artifactId>maven-compiler-plugin</artifactId>
  58. <version>${maven-compiler-plugin.version}</version>
  59. <configuration>
  60. <annotationProcessorPaths>
  61. <path>
  62. <groupId>org.springframework.boot</groupId>
  63. <artifactId>spring-boot-configuration-processor</artifactId>
  64. <version>${spring.boot.version}</version>
  65. </path>
  66. <path>
  67. <groupId>org.projectlombok</groupId>
  68. <artifactId>lombok</artifactId>
  69. <version>${lombok.version}</version>
  70. </path>
  71. <path>
  72. <groupId>org.mapstruct</groupId>
  73. <artifactId>mapstruct-processor</artifactId>
  74. <version>${mapstruct.version}</version>
  75. </path>
  76. </annotationProcessorPaths>
  77. <!-- 编译参数写在 arg 内,解决 Spring Boot 3.2 的 Parameter Name Discovery 问题 -->
  78. <debug>false</debug>
  79. <compilerArgs>
  80. <arg>-parameters</arg>
  81. </compilerArgs>
  82. </configuration>
  83. </plugin>
  84. <!--<plugin>
  85. <groupId>org.apache.maven.plugins</groupId>
  86. <artifactId>maven-jar-plugin</artifactId>
  87. <configuration>
  88. <skipIfEmpty>true</skipIfEmpty> &lt;!&ndash; 无代码时跳过 JAR 生成 &ndash;&gt;
  89. </configuration>
  90. </plugin>-->
  91. </plugins>
  92. </pluginManagement>
  93. <plugins>
  94. <!-- 统一 revision 版本 -->
  95. <plugin>
  96. <groupId>org.codehaus.mojo</groupId>
  97. <artifactId>flatten-maven-plugin</artifactId>
  98. <version>${flatten-maven-plugin.version}</version>
  99. <configuration>
  100. <flattenMode>oss</flattenMode>
  101. <updatePomFile>true</updatePomFile>
  102. </configuration>
  103. <executions>
  104. <execution>
  105. <goals>
  106. <goal>flatten</goal>
  107. </goals>
  108. <id>flatten</id>
  109. <phase>process-resources</phase>
  110. </execution>
  111. <execution>
  112. <goals>
  113. <goal>clean</goal>
  114. </goals>
  115. <id>flatten.clean</id>
  116. <phase>clean</phase>
  117. </execution>
  118. </executions>
  119. </plugin>
  120. </plugins>
  121. </build>
  122. <!-- 使用 huawei / aliyun 的 Maven 源,提升下载速度 -->
  123. <repositories>
  124. <repository>
  125. <id>huaweicloud</id>
  126. <name>huawei</name>
  127. <url>https://mirrors.huaweicloud.com/repository/maven/</url>
  128. </repository>
  129. <repository>
  130. <id>aliyunmaven</id>
  131. <name>aliyun</name>
  132. <url>https://maven.aliyun.com/repository/public</url>
  133. </repository>
  134. <repository>
  135. <id>spring-milestones</id>
  136. <name>Spring Milestones</name>
  137. <url>https://repo.spring.io/milestone</url>
  138. <snapshots>
  139. <enabled>false</enabled>
  140. </snapshots>
  141. </repository>
  142. <repository>
  143. <id>spring-snapshots</id>
  144. <name>Spring Snapshots</name>
  145. <url>https://repo.spring.io/snapshot</url>
  146. <releases>
  147. <enabled>false</enabled>
  148. </releases>
  149. </repository>
  150. </repositories>
  151. </project>