一、在Nexus\nexus-3.31.1-01\bin路徑下cmd進入控制臺輸入nexus.exe /run nexus啟動私服服務器
二、在瀏覽器輸入local host:8081進入私服頁面
三、在Maven\apache-maven-3.8.6\conf的setting.xml文件中設置本地倉庫訪問私服權限和地址
本地倉庫訪問私服權限
<server>
<id>chaoge-release</id>
<username>admin</username>
<password>chaoge1010</password>
</server><server>
<id>chaoge-snapshot</id>
<username>admin</username>
<password>chaoge1010</password>
</server>
地址
<mirror> <id>maven-public</id> <mirrorOf>*</mirrorOf> <url>http://localhost:8081/repository/maven-public/</url> </mirror>
四、在需要上傳到私服的工程中的pom文件中配置當前工程保存到私服中的具體位置
<distributionManagement>
<repository><!--發布版本-->
<id>chaoge-release</id>
<url>http://localhost:8081/repository/chaoge-release/</url>
</repository>
<snapshotRepository><!--快照版本-->
<id>chaoge-snapshot</id>
<url>http://localhost:8081/repository/chaoge-snapshot/</url>
</snapshotRepository>
</distributionManagement>
浙公網安備 33010602011771號