Maven 更换远程仓库地址

时间:2023-03-08 20:46:52
Maven 更换远程仓库地址

1.第一种方式,通过setting.xml的方式配置数据源

该文件路径D:\IDE\apache-maven-3.2.3\conf\setting.xml

该文件大部分内容都已经注释,我们需要添加如下内容:

<profile>
<id>dev</id>
<!-- repositories and pluginRepositories here-->
<repositories>
<repository>
<id>nexus-aliyun</id>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>dev</activeProfile>
</activeProfiles>