| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- 观澜 · Java 后端离线构建设置(可移植)。
- 目标机/本机可能没有外网 ⇒ 构件全部来自"用户本地仓"(由 settings-online.xml 事先下好)。
- ★ 实逮(2026-09-29):本地仓会为每个构件记来源仓库 id(`_remote.repositories`)。若离线设置的
- mirror/repository id 与当初下载时**不一致**,`mvn -o` 会报 "Cannot access central in offline mode",
- 哪怕 jar 就在本地。所以这里保留与 settings-online.xml **同名**的 id(aliyun-public),
- 并且构建命令另加 `-Dmaven.legacyLocalRepo=true`(本地仓权威,不按来源挑剔)。
- 用法:mvn -s app_backEnd/backend-java/settings-offline.xml -o -Dmaven.legacyLocalRepo=true compile
- (`${user.home}` 写法 —— 仓里不写死某台机器的盘符;构件在别处时用环境变量 GUANLAN_MVN_SETTINGS 覆盖)
- -->
- <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
- <localRepository>${user.home}/.m2/repository</localRepository>
- <offline>true</offline>
- <mirrors>
- <mirror>
- <id>aliyun-public</id>
- <name>Aliyun public (与联机下载时同名,离线解析才认)</name>
- <url>https://maven.aliyun.com/repository/public</url>
- <mirrorOf>central</mirrorOf>
- </mirror>
- </mirrors>
- <profiles>
- <profile>
- <id>guanlan-offline</id>
- <repositories>
- <repository>
- <id>aliyun-public-direct</id>
- <url>https://maven.aliyun.com/repository/public</url>
- <releases><enabled>true</enabled></releases>
- <snapshots><enabled>false</enabled></snapshots>
- </repository>
- <repository>
- <id>central-direct</id>
- <url>https://repo.maven.apache.org/maven2</url>
- <releases><enabled>true</enabled></releases>
- <snapshots><enabled>false</enabled></snapshots>
- </repository>
- </repositories>
- </profile>
- </profiles>
- <activeProfiles>
- <activeProfile>guanlan-offline</activeProfile>
- </activeProfiles>
- </settings>
|