pom.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. 观澜 · 后端(Java + Spring Boot + Swagger)—— 用户令 2026-09-29:后端完全用 Java + Spring Boot + Swagger 实现,
  4. 与算法模块经接口交互,行为与重构前一致(对拍基准:app_backEnd/app_backEnd_guanlan/contract/http_api_v1.json)。
  5. 工具链口径(本机实测):JDK 1.8.0_202(D:\Program Files\Java\jdk1.8.0_202)+ Maven 3.8.9;
  6. Maven Central 不可达,但用户级本地仓已含所需构件,故**离线编译**:
  7. mvn -o -Dmaven.repo.local=C:\Users\86189\.m2\repository package
  8. -->
  9. <project xmlns="http://maven.apache.org/POM/4.0.0"
  10. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  11. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  12. <modelVersion>4.0.0</modelVersion>
  13. <parent>
  14. <groupId>org.springframework.boot</groupId>
  15. <artifactId>spring-boot-starter-parent</artifactId>
  16. <version>2.7.18</version>
  17. <relativePath/>
  18. </parent>
  19. <groupId>com.guanlan</groupId>
  20. <artifactId>guanlan-backend</artifactId>
  21. <version>0.1.0</version>
  22. <name>guanlan-backend</name>
  23. <description>观澜 v2 后端(Java 8 + Spring Boot 2.7 + Swagger + MyBatis-Plus 预留)</description>
  24. <properties>
  25. <java.version>1.8</java.version>
  26. <maven.compiler.source>1.8</maven.compiler.source>
  27. <maven.compiler.target>1.8</maven.compiler.target>
  28. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  29. <springfox.version>3.0.0</springfox.version>
  30. </properties>
  31. <dependencies>
  32. <dependency>
  33. <groupId>org.springframework.boot</groupId>
  34. <artifactId>spring-boot-starter-web</artifactId>
  35. </dependency>
  36. <!-- Swagger:springfox 3(本地仓已有 springfox-boot-starter 3.0.0,含 swagger2 + swagger-ui) -->
  37. <dependency>
  38. <groupId>io.springfox</groupId>
  39. <artifactId>springfox-boot-starter</artifactId>
  40. <version>${springfox.version}</version>
  41. </dependency>
  42. <!--
  43. 离线实逮(2026-09-29):springfox 3 的 swagger2 映射器在运行期要 `org.mapstruct.factory.Mappers`,
  44. 但它在 springfox 的 POM 里是 provided/未传递 ⇒ 直接跑会
  45. `NoClassDefFoundError: org/mapstruct/factory/Mappers`(启动即失败)。显式补上(本机仓有 1.3.1.Final)。
  46. -->
  47. <dependency>
  48. <groupId>org.mapstruct</groupId>
  49. <artifactId>mapstruct</artifactId>
  50. <version>1.3.1.Final</version>
  51. </dependency>
  52. <dependency>
  53. <groupId>org.springframework.boot</groupId>
  54. <artifactId>spring-boot-starter-test</artifactId>
  55. <scope>test</scope>
  56. </dependency>
  57. </dependencies>
  58. <build>
  59. <finalName>guanlan-backend</finalName>
  60. <!--
  61. 离线实逮(2026-09-29):本机仓里几个**老版本**构建插件(jar 3.2.2 / resources 3.2.0 / compiler 3.10.1)
  62. 的 POM 会牵出 `plexus-utils:1.1`,而本机仓里没有 1.1(只有 1.0.4/1.4.1/…/3.4.1)⇒ 离线报
  63. "Cannot access central ... plexus-utils:jar:1.1 has not been downloaded"。
  64. 做法:显式把插件钉到本机仓里**已齐备**的新版本(依赖都是 plexus-utils 3.x),不再走老版本的解析路径。
  65. -->
  66. <pluginManagement>
  67. <plugins>
  68. <plugin>
  69. <groupId>org.apache.maven.plugins</groupId>
  70. <artifactId>maven-compiler-plugin</artifactId>
  71. <version>3.10.1</version>
  72. </plugin>
  73. <plugin>
  74. <groupId>org.apache.maven.plugins</groupId>
  75. <artifactId>maven-resources-plugin</artifactId>
  76. <version>3.2.0</version>
  77. </plugin>
  78. <plugin>
  79. <groupId>org.apache.maven.plugins</groupId>
  80. <artifactId>maven-jar-plugin</artifactId>
  81. <version>3.2.2</version>
  82. <dependencies>
  83. <!-- 3.2.2 的 POM 会牵出 plexus-utils:1.1(本机仓没有)⇒ 显式顶到本机已有的 3.4.1 -->
  84. <dependency>
  85. <groupId>org.codehaus.plexus</groupId>
  86. <artifactId>plexus-utils</artifactId>
  87. <version>3.4.1</version>
  88. </dependency>
  89. <dependency>
  90. <groupId>org.apache.maven</groupId>
  91. <artifactId>maven-archiver</artifactId>
  92. <version>3.6.0</version>
  93. </dependency>
  94. </dependencies>
  95. </plugin>
  96. <plugin>
  97. <groupId>org.apache.maven.plugins</groupId>
  98. <artifactId>maven-install-plugin</artifactId>
  99. <version>2.5.2</version>
  100. </plugin>
  101. </plugins>
  102. </pluginManagement>
  103. <plugins>
  104. <plugin>
  105. <groupId>org.springframework.boot</groupId>
  106. <artifactId>spring-boot-maven-plugin</artifactId>
  107. <!--
  108. 离线实逮(2026-09-29):本机仓没有 `spring-boot-loader-tools:2.7.18`(repackage 的依赖),
  109. 故**不打 fat jar**,改出"瘦 jar + lib/ 依赖目录"(见 build-offline.cmd 的说明):
  110. 目标机用随包 JRE 跑 `java -cp "guanlan-backend.jar;lib/*" com.guanlan.backend.GuanlanBackendApplication`。
  111. -->
  112. <configuration>
  113. <skip>true</skip>
  114. </configuration>
  115. </plugin>
  116. <plugin>
  117. <groupId>org.apache.maven.plugins</groupId>
  118. <artifactId>maven-surefire-plugin</artifactId>
  119. <executions>
  120. <execution>
  121. <id>default-test</id>
  122. <phase>none</phase>
  123. </execution>
  124. </executions>
  125. </plugin>
  126. </plugins>
  127. </build>
  128. </project>