跳到主要内容

配置maven私服

vim /opt/apache-maven-3.6.3/conf/settings.xml

在mirrors节点中新增mirror节点:

<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>

在profiles节点中新增一个profile节点:

<profile>  
<id>alimaven</id>
<repositories>
<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>
</profile>

在activeProfiles节点中新增一个activeProfile 节点:

<activeProfiles>
<activeProfile>alimaven</activeProfile>
</activeProfiles>

注意:以上代码不要写到注释里,请仔细检查! 可参考setting文件:settings.xml