离线更新中央仓库索引的方式,速度快并且可靠。

  1. 访问http://repo.maven.apache.org/maven2/.index/下载中心仓库最新版本的索引文件,我们需要下载如下两个文件nexus-maven-repository-index.gz和nexus-maven-repository-index.properties。
  2. 进入nexus安装目录\sonatype-work进入indexer目录,因为我们的代理名为central所以找到central-ctx ,将下载好的文件解压进去后。重新启动nexus,若能在central 的browse index中看到和remote一样的索引,即代表成功完成。

settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>D:\Maven\repository</localRepository>
<servers>
<server>
<id>public</id> <!-- 对应server节点的id -->
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>releases</id><!--这个ID要与下面的repository中的ID一致-->
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<mirrors>
<mirror>
<id>public</id> <!-- 对应server节点的id -->
<name>Public Repositories</name>
<url>http://xxx/nexus/content/groups/public/</url><!-- 私服仓库地址 -->
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors> <profiles>
<profile>
<id>public</id>
<repositories>
<repository>
<id>releases</id><!--正式仓库id-->
<name>Releases</name>
<url>http://xxx/nexus/content/repositories/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<name>Snapshots</name>
<url>http://xxx/nexus/content/repositories/snapshots</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories><!--插件仓库地址,各节点的含义和上面是一样的-->
<pluginRepository>
<id>releases</id>
<name>Releases</name>
<url>http://xxx/nexus/content/repositories/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>snapshots</id>
<name>Releases</name>
<url>http://xxx/nexus/content/repositories/snapshots</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>public</activeProfile>
</activeProfiles>
</settings>

pom.xml:

<distributionManagement>
<repository>
<id>releases</id><!--正式仓库id-->
<name>Releases</name>
<url>http://xxx/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Snapshots</name>
<url>http://xxx/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

一些常用的软件仓库:

  http://maven.aliyun.com/nexus/content/groups/public(阿里云,推荐)

  http://repo1.maven.org/maven2

  http://repository.sonatype.org/content/groups/public/

maven仓库位置寻找

  http://mvnrepository.com

项目中直接使用其他仓库

<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories> <pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

nexus 随笔的更多相关文章

  1. 使用Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境(二)

    前言     上一篇随笔Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境(一)介绍maven和nexus的环境搭建,以及如何使用maven和nexus统一管理库 ...

  2. Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境(二)

    上一篇随笔Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境(一)介绍maven和nexus的环境搭建,以及如何使用maven和nexus统一管理库文件和版本,以 ...

  3. 一周Maven框架学习随笔

    第一次写博客,可能写得不是很好,但是希望自己持之以恒,以后会更好.也希望通过写博客记录随笔,让自己本身有所收获. 下面是今天的maven总结: maven个人理解中是Maven项目对象模型(POM), ...

  4. 使用Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境

    前言 但凡一个略有规模的项目都需要一个持续集成环境的支撑,为什么需要持续集成环境,我们来看一个例子.假如一个项目,由A.B两位程序员来协作开发,A负责前端模块,B负责后端模块,前端依赖后端.A和B都习 ...

  5. Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境

    使用Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境(一) 2015-01-14 20:28 by 飘扬的红领巾, 4322 阅读, 5 评论, 收藏, 编辑 ...

  6. 【原创】Docker 搭建Maven私服nexus 3.17初始密码登录不上问题/admin登陆不上问题

    [原创-转载请说明出处] 博主最近在虚拟机中搭建Maven私服,遇到了一个关键问题就是nexus 3.17版本后初始密码不是admin/admin123. 对于nexus不熟悉的我弄了很长时间!!!心 ...

  7. AI人工智能系列随笔

    初探 AI人工智能系列随笔:syntaxnet 初探(1)

  8. 【置顶】CoreCLR系列随笔

    CoreCLR配置系列 在Windows上编译和调试CoreCLR GC探索系列 C++随笔:.NET CoreCLR之GC探索(1) C++随笔:.NET CoreCLR之GC探索(2) C++随笔 ...

  9. C++随笔:.NET CoreCLR之GC探索(4)

    今天继续来 带大家讲解CoreCLR之GC,首先我们继续看这个GCSample,这篇文章是上一篇文章的继续,如果有不清楚的,还请翻到我写的上一篇随笔.下面我们继续: // Initialize fre ...

随机推荐

  1. failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected 排坑指南

    训练maskrcnn时,出现了 failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected 一开始以 ...

  2. C语言文件(例题及要点)

    char str[100] = "HELLOhello 123456789ABCD abcd!"; FILE *fp1, &fp2;//文件指针 fp1 = fopen(& ...

  3. SQL-58 获取有奖金的员工相关信息。

    题目描述 获取有奖金的员工相关信息.CREATE TABLE `employees` (`emp_no` int(11) NOT NULL,`birth_date` date NOT NULL,`fi ...

  4. impala和kudu使用的小细节

    七堇年:我们要有最朴素的生活与最遥远的梦想 . 即使明日天寒地冻,路远马亡.   加油! 之前入门的小错误总结,建表都会出错,真的好尴尬 还是要做好笔记 第一个错误: error:AnalysisEx ...

  5. 前端开发【第四篇: Dom操作】

    文档对象模型(Document Object Model,DOM)是一种用于HTML和XML文档的编程接口.它给文档提供了一种结构化的表示方法,可以改变文档的内容和呈现方式.我们最为关心的是,DOM把 ...

  6. Debian 系linux切换登录管理器(display manager)

    在控制台中sudo dpkg-reconfigure <你的dm包名>即可dm选择列表,选择自己需要的dm 例如ubutu18默认使用gdm3,则输入命令: sudo dpkg-recon ...

  7. C++面试笔记(3)

    20. 浅拷贝与深拷贝 如何理解C++中的浅拷贝与深拷贝 深拷贝和浅拷贝 在进行对象拷贝时,当对象包含对其他资源的引用,如果需要拷贝这个独享所引用的对象,那就是深拷贝,否则就是浅拷贝 *** 21.构 ...

  8. TCP学习总结(二)

    前面一节咱们介绍完了TCP协议,这部分,将要介绍,TCP是如何实现可靠传输的. TCP的可靠传输 1.滑动窗口 上一节我们介绍TCP报文段头部的时候说得到,"窗口"这个部分,&qu ...

  9. TCP学习总结(一)

    在学习的过程中,相信大家都有过“学了就忘“这种经历,又特别是TCP/IP知识点密集的通信协议,所以在此总结一下自己学到的皮毛,希望对自己对大家也有所帮助. 这篇博客主要讲运输层TCP和UDP的东西,I ...

  10. shell脚本判断安装包位置及类型

    Log() { LogFile=/tmp/``.log LogDate=$(date +"%F %T") echo -e "\n\n||| ${LogDate} ||| ...