一、在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号