maven 3.3.1之后,使用project-settings-extension${basedir}/.mvn/settings.xml
加载项目设置,在每个项目中放入项目特定的镜像。
在${basedir}/.mvn/extensions.xml
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
<extension>
<groupId>com.github.gzm55.maven</groupId>
<artifactId>project-settings-extension</artifactId>
<version>0.1.1</version>
</extension>
</extensions>
在${basedir}/.mvn/settings.xml
<settings>
<mirrors>
<mirror>
<id>id</id>
<url>https://url-for-this-project/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
</settings>