settings-online.xml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. 观澜 · Java 后端**联网构建**设置(P12-a)。
  4. 背景(2026-09-29 实逮纠正):上一轮判"Maven Central 不可达"是**瞬时探测失败**,实际可达
  5. (repo.maven.apache.org / maven.aliyun.com / repo.huaweicloud.com / mirrors.cloud.tencent.com 均 200)。
  6. 本文件用于:把用户令要求补齐的 spring-cloud-starter-gateway · spring-boot-starter-security ·
  7. OAuth2/JWT 等构件**下到用户本地仓**(C:\Users\<用户>\.m2\repository),之后仍可用 settings-offline.xml 离线编译。
  8. 用法:mvn -s app_backEnd/backend-java/settings-online.xml -DskipTests compile
  9. (settings.xml 里 localRepository 用 ${user.home} 写法 —— 换机不写死盘符)
  10. 镜像优先阿里云 public(聚合 Central + Spring 等),失败再回落到 Central。
  11. -->
  12. <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  13. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  14. xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
  15. <localRepository>${user.home}/.m2/repository</localRepository>
  16. <mirrors>
  17. <mirror>
  18. <id>aliyun-public</id>
  19. <name>Aliyun public (Central + Spring + others)</name>
  20. <url>https://maven.aliyun.com/repository/public</url>
  21. <mirrorOf>central</mirrorOf>
  22. </mirror>
  23. </mirrors>
  24. <profiles>
  25. <profile>
  26. <id>guanlan-online</id>
  27. <repositories>
  28. <repository>
  29. <id>central-direct</id>
  30. <url>https://repo.maven.apache.org/maven2</url>
  31. <releases><enabled>true</enabled></releases>
  32. <snapshots><enabled>false</enabled></snapshots>
  33. </repository>
  34. <repository>
  35. <id>aliyun-public-direct</id>
  36. <url>https://maven.aliyun.com/repository/public</url>
  37. <releases><enabled>true</enabled></releases>
  38. <snapshots><enabled>false</enabled></snapshots>
  39. </repository>
  40. </repositories>
  41. <pluginRepositories>
  42. <pluginRepository>
  43. <id>aliyun-public-plugins</id>
  44. <url>https://maven.aliyun.com/repository/public</url>
  45. <releases><enabled>true</enabled></releases>
  46. <snapshots><enabled>false</enabled></snapshots>
  47. </pluginRepository>
  48. </pluginRepositories>
  49. </profile>
  50. </profiles>
  51. <activeProfiles>
  52. <activeProfile>guanlan-online</activeProfile>
  53. </activeProfiles>
  54. </settings>