Maven Settings.xml 配置模板
https://www.cnblogs.com/simpleJokerKing/p/14202514.html
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- 配置本地仓库 -->
<localRepository>x:/xxx_repository</localRepository>
<servers>
<server>
<id>xxx-releases</id>
<username>xxx</username>
<password>xxx</password>
</server>
<server>
<id>xxx-snapshot</id>
<username>xxx</username>
<password>xxx</password>
</server>
</servers>
<!-- 配置镜像 -->
<mirrors>
<mirror>
<id>nexus</id>
<!-- 表示该镜像匹配所有仓库,任何对于远程仓库的请求都会被转至 http://xxx.xxx.xxx.xxx:xxx/nexus/content/groups/public/ -->
<mirrorOf>*</mirrorOf>
<url>http://xxx.xxx.xxx.xxx:xxx/nexus/content/groups/public/</url>
</mirror>
</mirrors>
<!-- 使用 settings.xml 的 profile 机制配置(本机)全局仓库信息 -->
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<!-- id都为central,也就是说,覆盖了超级POM中央仓库的配置 -->
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
--Demo
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>D:\maven_store\maven_store</localRepository>
<pluginGroups>
<pluginGroup>org.apache.tomcat.maven</pluginGroup>
</pluginGroups>
<proxies>
</proxies>
<servers>
<server>
<id>maven-public</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>maven-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>maven-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://IP:8081/repository/maven-public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Nexus</name>
<url>http://central/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>