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

  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. linux安装anaconda3 conda: command not found

    在使用Anaconda3时出现: conda:未找到命令 最后发现每次开机后都要运行一个命令才行:export PATH=~/anaconda3/bin:$PATH 如果要永久保存路径: 1.在终端输 ...

  2. throw与throws

    throws可以单独使用(一直上抛) throw要么和try-catch-finally语句配套使用,要么与throws配套使用 /** * 总结: *    1.throws是方法抛出异常.如: p ...

  3. 【Java集合系列六】LinkedHashMap解析

    2017-08-14 16:30:10 1.简介 LinkedHashMap继承自HashMap,能保证迭代顺序,支持其他Map可选的操作.采用双向链表存储元素,默认的迭代序是插入序.重复插入一个已经 ...

  4. Python随笔--代理ip

  5. if -----if else语句

    if语句是用来进行判断的,其使用格式如下: 单分支 if 判断的条件: 满足条件后要执行的代码 双分支 if 条件: 满足条件执行代码 else: if条件不满足就走这段 这里必须要插入这个缩进的知识 ...

  6. 使用飞冰组件关于点击行回填在input内(React)

    import { Table,Grid } from "@icedesign/base"; import { FormBinderWrapper as IceFormBinderW ...

  7. LeetCode 160 相交链表

    题目: 编写一个程序,找到两个单链表相交的起始节点. 如下面的两个链表: 在节点 c1 开始相交. 示例 1: 输入:intersectVal = 8, listA = [4,1,8,4,5], li ...

  8. 微信机器人 返现机器人 pc版本 移动版本 java开发 小范省钱

    微信机器人 返现机器人 pc版本 移动版本 java开发 小范省钱 微信搜索微信号 fanli-x 或 扫描下方二维码,可查看效果. 非web版微信,pc/移动版微信 支持新号24小时 不封号! 有任 ...

  9. hive lock命令的使用

    1.hive锁表命令 hive> lock table t1 exclusive;锁表后不能对表进行操作 2.hive表解锁: hive> unlock table t1; 3.查看被锁的 ...

  10. 专业的“python爬虫工程师”需要学习哪些知识?

    学到哪种程度 暂且把目标定位初级爬虫工程师,简单列一下吧: (必要部分) 熟悉多线程编程.网络编程.HTTP协议相关 开发过完整爬虫项目(最好有全站爬虫经验,这个下面会说到) 反爬相关,cookie. ...