修改 settings.xml
第一步
<server>
<id>nexusSnapshots</id>
<username>admin</username>
<password>admin</password>
</server>
第二步
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexusSnapshots</id>
<url>http://ip:port/repository/maven-public/</url>
<snapshots>
<enabled>
true
</enabled>
</snapshots>
<releases>
<enabled>
true
</enabled>
</releases>
</repository>
</repositories>
</profile>
第三步
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
注意id的对应,名称可以随便起,但是需要对应上
server-->repository
profile-->activeProfile
注意:把mirror 先注释掉