Nexus Repository Manager OSS 3.x 安装
- 下载
选择对应的版本下载,以nexus-3.6.0-02-win64()为例;
- 解压
将nexus-3.6.0-02-win64.zip解压至对应目录;
- 执行
...\nexus-3.6.0-02-win64\nexus-3.6.0-02\bin>nexus.exe /run
- 修改配置
配置文件位于:\etc\nexus-default.properties
- application-port=8091 内嵌Jetty对应Web服务端口号;
- application-host=0.0.0.0 对应Host;
- nexus-context-path=/nexus
- 注册服务(Windows Platform)
...\nexus-3.6.0-02-win64\nexus-3.6.0-02\bin>nexus.exe /install nexus
- Nexus Repository Manager 管理页面
URL:http://localhost:8091/nexus;
点击右上角Sign in 按钮登录。默认用户名:admin,密码:admin123;
点击齿轮状配置按钮,进入配置页面;
- Nexus、Maven结合使用,建立本地私库
- 修改Maven全局或者本地settings.xml;
- 或者直接配置在项目的POM文件中;
上述两种方式均可;
settings.xml增加如下配置:
<localRepository>D:\...\repository-dev</localRepository>
<mirror>
<id>nexus-public</id> <mirrorOf>central</mirrorOf> <name>Nexus Repository</name> <url>http://<Host>:8091/nexus/repository/maven-public/</url> </mirror><server>
<id>nexus-releases</id> <username>dev</username> <password>123456</password> </server> <server> <id>nexus-snapshot</id> <username>dev</username> <password>123456</password> </server>POM 文件修改实例:
nexus-public nexus-public http:// :8091/nexus/repository/maven-public/ true true nexus-nexus Releases http:// :8091/nexus/repository/maven-releases/ nexus-nexus Snapshot http:// :8091/nexus/repository/maven-snapshots/
-------------------------------------------------------------------------------------------------------------
本地私库即可从远程仓库下载资源了: