分两种情况介绍
一、新建项目直接上到私服
1.在要上传的maven项目的pom.xml配置文件中,添加如下要素:
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Nexus Release Repository</name>
<url>http://192.168.101.14:9088/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://192.168.101.14:9088/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
说明:
a.repository 是上传Release 版本的jar包,snapshotRepository是上传snapshot(非正式或不稳定版本)的jar包。
b.其中两个 id 的值 (nexus-releases,nexus-snapshots) 是在maven_home\conf\settings.xml配置文件中 services 配置的 id
见下图所示:

2.以上配置完成以后,点击eclipse run as --- > maven build--> deploy,如果控制台输出的success,则表示发布成功,步骤见下图2和图3(本演示案例使用的eclipse2020-06版)


二、已有项目需要更新到私服
跳过上述方案一中的步骤1,直接步骤2,就能更新完成。
效果图如下:
