Nexus2:使用

来自Wikioe
跳到导航 跳到搜索


关于

浏览仓库

参考: https://help.sonatype.com/repomanager2/using-the-user-interface/browsing-repositories

管理仓库

参考: https://help.sonatype.com/repomanager2/configuration/managing-repositories

初始使用

代理仓库:更新远程索引

如图:

Nexus2:代理仓库“更新远程索引”.png
  • 其实就是在 Scheduled Tasks 增加了任务,用于更新该代理仓库的远程索引。

宿主仓库:设置可重复部署

如图:

Nexus2:宿主仓库“可重复部署”.png

网络代理

有时候局域网是不能直接访问网络的,需要通过防火墙代理来上网,这个时候就需要在 Nexus 里配置代理来访问中央仓库和索引文件了。

如图:

Nexus2:网络代理设置.png

在 Maven 中使用 Nexus

项目配置

pom.xml 示例:(展开/隐藏)

  1. <repositories> 用于依赖下载;
  2. <distributionManagement> 用于部署上传;
    • <id> 必须与 setting.xml 中 <server> 下 <id> 一致

全局配置

settings.xml 示例:(展开/隐藏)

其他

离线更新索引

参考: http://m.biancheng.net/nexus/offline-indexs.html