pom.xml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  4. <modelVersion>4.0.0</modelVersion>
  5. <groupId>com.hosea.cloud.user</groupId>
  6. <artifactId>service-user</artifactId>
  7. <version>${revision}</version>
  8. <packaging>pom</packaging>
  9. <name>Service User ${version}</name>
  10. <description>用户服务</description>
  11. <properties>
  12. <revision>1.0.0</revision>
  13. <hosea-cloud.version>1.0.1</hosea-cloud.version>
  14. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  15. <flatten-maven-plugin.version>1.7.2</flatten-maven-plugin.version>
  16. <maven-surefire-plugin.version>3.5.3</maven-surefire-plugin.version>
  17. <spring-boot.version>3.2.12</spring-boot.version>
  18. <mysql.version>8.0.32</mysql.version>
  19. </properties>
  20. <modules>
  21. <module>service-user-client</module>
  22. <module>service-user-adapter</module>
  23. <module>service-user-app</module>
  24. <module>service-user-domain</module>
  25. <module>service-user-infrastructure</module>
  26. <module>start</module>
  27. </modules>
  28. <dependencies>
  29. <!--region 微服务脚手架-->
  30. <dependency>
  31. <groupId>com.hosea.cloud</groupId>
  32. <artifactId>hosea-cloud</artifactId>
  33. <version>${hosea-cloud.version}</version>
  34. <type>pom</type>
  35. </dependency>
  36. <!--endregion-->
  37. </dependencies>
  38. <dependencyManagement>
  39. <dependencies>
  40. <!--region 项目模块-->
  41. <dependency>
  42. <groupId>com.hosea.cloud.user</groupId>
  43. <artifactId>service-user-client</artifactId>
  44. <version>${revision}</version>
  45. </dependency>
  46. <dependency>
  47. <groupId>com.hosea.cloud.user</groupId>
  48. <artifactId>service-user-adapter</artifactId>
  49. <version>${revision}</version>
  50. </dependency>
  51. <dependency>
  52. <groupId>com.hosea.cloud.user</groupId>
  53. <artifactId>service-user-app</artifactId>
  54. <version>${revision}</version>
  55. </dependency>
  56. <dependency>
  57. <groupId>com.hosea.cloud.user</groupId>
  58. <artifactId>service-user-domain</artifactId>
  59. <version>${revision}</version>
  60. </dependency>
  61. <dependency>
  62. <groupId>com.hosea.cloud.user</groupId>
  63. <artifactId>service-user-infrastructure</artifactId>
  64. <version>${revision}</version>
  65. </dependency>
  66. <!--endregion-->
  67. <!--region 微服务脚手架-->
  68. <dependency>
  69. <groupId>com.hosea.cloud</groupId>
  70. <artifactId>hosea-cloud</artifactId>
  71. <version>${hosea-cloud.version}</version>
  72. <type>pom</type>
  73. <scope>import</scope>
  74. </dependency>
  75. <!--endregion-->
  76. <dependency>
  77. <groupId>mysql</groupId>
  78. <artifactId>mysql-connector-java</artifactId>
  79. <version>${mysql.version}</version>
  80. </dependency>
  81. </dependencies>
  82. </dependencyManagement>
  83. <build>
  84. <pluginManagement>
  85. <plugins>
  86. <!--region JDK版本-->
  87. <plugin>
  88. <groupId>org.apache.maven.plugins</groupId>
  89. <artifactId>maven-compiler-plugin</artifactId>
  90. <configuration>
  91. <source>17</source>
  92. <target>17</target>
  93. <encoding>${project.build.sourceEncoding}</encoding>
  94. </configuration>
  95. </plugin>
  96. <!--endregion-->
  97. <!--region Spring Boot 可执行包-->
  98. <plugin>
  99. <groupId>org.springframework.boot</groupId>
  100. <artifactId>spring-boot-maven-plugin</artifactId>
  101. <version>${spring-boot.version}</version>
  102. <executions>
  103. <execution>
  104. <goals>
  105. <goal>repackage</goal>
  106. </goals>
  107. </execution>
  108. </executions>
  109. </plugin>
  110. <!--endregion-->
  111. <!--region 动态版本号-->
  112. <plugin>
  113. <groupId>org.codehaus.mojo</groupId>
  114. <artifactId>flatten-maven-plugin</artifactId>
  115. <version>${flatten-maven-plugin.version}</version>
  116. <configuration>
  117. <!-- 配置扁平化后的 POM 文件的名称 -->
  118. <flattenedPomFilename>pom-xml-flattened</flattenedPomFilename>
  119. <!-- 是否更新原始 POM 文件 -->
  120. <updatePomFile>true</updatePomFile>
  121. <!-- 指定扁平化模式,resolveCiFriendliesOnly 表示仅解析 CI 友好的占位符 -->
  122. <flattenMode>resolveCiFriendliesOnly</flattenMode>
  123. </configuration>
  124. <executions>
  125. <!-- 定义插件的执行配置 -->
  126. <execution>
  127. <!-- 执行的唯一标识 -->
  128. <id>flatten</id>
  129. <!-- 指定插件绑定的生命周期阶段 -->
  130. <phase>process-resources</phase>
  131. <!-- 定义执行的目标 -->
  132. <goals>
  133. <!-- 执行扁平化操作 -->
  134. <goal>flatten</goal>
  135. </goals>
  136. </execution>
  137. <!-- 定义清理阶段的执行配置 -->
  138. <execution>
  139. <!-- 清理阶段的唯一标识 -->
  140. <id>flatten.clean</id>
  141. <!-- 指定清理阶段绑定的生命周期阶段 -->
  142. <phase>clean</phase>
  143. <!-- 定义清理阶段执行的目标 -->
  144. <goals>
  145. <!-- 执行清理操作 -->
  146. <goal>clean</goal>
  147. </goals>
  148. </execution>
  149. </executions>
  150. </plugin>
  151. <!--endregion-->
  152. <!--region 让Maven test能正常执行-->
  153. <plugin>
  154. <groupId>org.apache.maven.plugins</groupId>
  155. <artifactId>maven-surefire-plugin</artifactId>
  156. <version>${maven-surefire-plugin.version}</version>
  157. <configuration>
  158. <includes>
  159. <!--只需执行这一个类,由于Junit只能做到方法的顺序执行,不能做类的顺序执行,所以这个类做了手动排序-->
  160. <include>**/AllTest.java</include>
  161. </includes>
  162. <forkCount>1</forkCount>
  163. <reuseForks>false</reuseForks>
  164. </configuration>
  165. </plugin>
  166. <!--endregion-->
  167. </plugins>
  168. </pluginManagement>
  169. <plugins>
  170. <!--region 动态版本号-->
  171. <plugin>
  172. <groupId>org.codehaus.mojo</groupId>
  173. <artifactId>flatten-maven-plugin</artifactId>
  174. </plugin>
  175. <!--endregion-->
  176. <!--region 让Maven test能正常执行-->
  177. <plugin>
  178. <groupId>org.apache.maven.plugins</groupId>
  179. <artifactId>maven-surefire-plugin</artifactId>
  180. </plugin>
  181. <!--endregion-->
  182. </plugins>
  183. </build>
  184. </project>