- 首先下载Nexus,网址:https://blog.sonatype.com/
- 在安装目录/nexus-latest-bundle/nexus-2.8.1-01/bin下使用管理员cmd窗口打开,运行nexus start
- 打开网址:http://127.0.0.1:8081/nexus/#welcome,如有下图则表示安装成功
4.私服中默认的仓库
几种 type 是什么意思
proxy:这是代理方式,它是用来代理中央仓库的,例如我们依赖的包在本地仓库没有,就会到私服获取,私服没有的话,会到中央仓库先把包下载到这里,然后再下载到本地仓库;
hosted:指的是我们公司或团队内部的包,并且 hosted 类型的仓库会分为 releases 和 snapshots
两个,前者是正式版,后者一般是开发测试版;
group:它的目的就是把多个仓库组合起来,然后我们项目中只需要配置上这个类型的仓库地址,就可以把它里面组合的几个仓库都关联上
- 在maven中的setting.xml文件中配置私服的登录账号和密码以及私服地址的设置
私服id、账号密码的设置私服测试版账号密码的设置 nexus admin admin123 私服正式版账号密码的设置 nexus-snapshots admin admin123 配置私服镜像 nexus-releases admin admin123 定义全局的配置信息 nexus internal nexus repository http://localhost:8081/repository/maven-public/ !internal.repo,* 激活配置文件 nexus //注意这里的id要与前面server标签中的对应 nexus Nexus Central http://localhost:8081/repository/maven-public/ default true true //注意这里的id要与前面server标签中的对应 nexus Nexus Central http://localhost:8081/repository/java-group/ default true true nexus
- 在maven项目中使用,则需在pom文件中加入
maven-public maven-public http://nexus.local:8081/repository/maven-public/ true



