一、测试环境
Sonatype Nexus 3.61.0-02
Maven 3.9.2
二、环境配置
2.1找到maven的配置文件

2.2添加私有仓库账户密码
xml
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin</password>
</server>
</servers>

2.3修改pom.xml文件
xml
<distributionManagement>
<repository>
<id>nexus</id>
<name>Nexus Releases Repository</name>
<url>http://localhost:8081/repository/maven-snapshots/</url>
</repository>
</distributionManagement>

2.4 发布

运行完成后可以在nexus看到已经上传上来了