【LJ?Dragon】鱼对水说你看不到我的眼泪,因为我在水里。水说我能感觉到你的眼泪,因为你在我心里。
【LJ?Dragon】You’re more than a shadow, I’ve just to believe.
【LJ?Dragon】A true friend is some one who reaches for your hand and touches your heart.
在%USERPROFILE%\.m2\settings.xml
例如:C:\Users\LongShu\.m2\settings.xml
可以自定义Maven的一些参数,
复制%M2_HOME%\conf\settings.xml
到这个目录修改一下配置。
1.修改本地仓库
在settings节点里添加
<localRepository>D:\Dev_Tool\m2repository</localRepository>
本地仓库地址将从%USERPROFILE%\.m2\
变为D:\Dev_Tool\m2repository\
2.修改远程仓库
在mirrors节点内添加将把原来https的仓库变为http的aliyun中央仓库。
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
<mirror>
<id>jcenter</id>
<mirrorOf>central</mirrorOf>
<name>jcenter.bintray.com</name>
<url>http://jcenter.bintray.com/</url>
</mirror>
<mirror>
<id>repo1</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo1.maven.org/maven2/</url>
</mirror>
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
3.修改项目仓库
在项目pom.xml的project节点内添加以下内容即可
<repositories>
<repository>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</repository>
<repository>
<id>jcenter</id>
<name>jcenter Repository</name>
<url>http://jcenter.bintray.com/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>