参考地址:https://maven.apache.org/settings.html
Maven 配置完整版,完成如下设定:
- 指定本地仓库地址
- 设置 deploy 的账号
- 配置 Nexus 私服
<?xml version="1.0" encoding="UTF-8"?>
<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
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>E:/work/repo</localRepository>
<!-- interactiveMode
| Default: true
<interactiveMode>true</interactiveMode>
-->
<!-- offline
| Default: false
<offline>false</offline>
-->
<pluginGroups></pluginGroups>
<servers>
<server>
<id>root</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<mirrors></mirrors>
<proxies></proxies>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexus3</id>
<name>Nexus3 Maven Public</name>
<url>http://localhost:8081/repository/maven-public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus3</id>
<name>Nexus3 Maven Public</name>
<url>http://localhost:8081/repository/maven-public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>