<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">
<!-- Default: ${user.home}/.m2/repository -->
<localRepository>D:/tool/maven/mavenRepository</localRepository>
<mirrors>
<!-- <mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
-->
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
<mirror>
<id>local-releases</id>
<mirrorOf>*</mirrorOf>
<url>http://maven.abc:8088/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
<setting>
localRepository:这里配值本地maven库地址.默认为用户/.m2/repository地址
mirror:镜像地址local-release本地库私服,nexus-aliyun远程阿里库,先在本地仓库下载,再去远程库下载;
此地址不想在maven的setting文件配值,也可以在项目的pom.xml配值,一般都在parent项目里配值.
示例如下:
<repositories> <repository> <id>loaclNexusTwo</id> <!-- local maven (本地私服) --> <url>http://nexus.local.cn/repository/maven-public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <!-- local maven (元程私服) --> <repository> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories>
此文都是个人理解,不对的地方还请多多包涵.