Nexus的安装及配置
下载链接:
nexus-3.13.0-01-unix.tar.gz : https://pan.baidu.com/s/1_-oMZ3fHbRyi9aPBOogAzw
nexus-3.12.1-01-win64.zip : https://pan.baidu.com/s/1Fjr46td3a93CXoe9Jb0jcw
nexus-2.12.0-01-bundle.zip : https://pan.baidu.com/s/1KyQJvW7fFt4kQ3sM6Jin3w
nexus-2.11.4-01-bundle.tar.gz : https://pan.baidu.com/s/1fL2L5DbIDtbGAJy_rdHorw
安装
1.下载完成解压后会有两个文件夹
2.然后管理员方式运行cmd, 进入nexus\bin目录下
3.输入命令:
nexus.exe /install
nexus.exe /run
4.查看后台计算机管理中的服务列表
5. localhost:8081 查看登录nexus(可能部分延迟情况需要等到30秒到1分钟时间)
(3.x版本对比2.x版本界面有点变化)
默认用户密码为:
admin
admin123
项目连接
1.maven文件配置修改:
本地setting.xml里面在节点下添加内容
<servers>
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
修改过用户密码的就修改成对应的
2.在项目的pom.xml中配置nexus:
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Nexus Release Repository</name>
<url>http://localhost:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://localhost:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
id跟settin.xml配置的id对应
url对应nexus的仓库
3.项目提交上去私服测试:
命令:
mvn deploy
上次版本发布快照等对应pom.xml的配置, 快照版可多次上传有序号分别.
从私服下载需加的配置:
在pom.xml中的节点下添加
<repository>
<id>nexus</id>
<name>Nexus Repository</name>
<url>http://localhost:8081/repository/maven-public/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
加多节点
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>Nexus Plugin Repository</name>
<url>http://localhost:8081/repository/maven-public/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
<pluginRepository>
<id>aliyun-repos</id>
<name>Aliyun Repository</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>