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

  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. windows 10系统在右键中添加管理员打开cmd

    需要修改注册表内容,新建文件,后缀名改为reg,文件中粘贴下边的代码 Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory ...

  2. 用generator 根据oracle表生成java代码,数据库与代码字段不一致

    前两天用generator生成java代码时发现,生成的javabean和数据库里的字段对应不上,不是少几个就是有几个字段不一样,感觉很怪异,后来发现日志里边这个表转换成bean是日志打印了好几遍,所 ...

  3. static易错点

    package com.juemuren.Error; /** * static关键字的易错点 */class SuperClass{    static{        System.out.pri ...

  4. OTP gen_server

    erlang behaviour小结之gen_server OTP入门 分类: Erlang2012-08-06 18:55 867人阅读 评论(0) 收藏 举报 servererlangcallba ...

  5. BUAAOO第二单元总结之电梯问题

    ---恢复内容开始--- Homework1 傻瓜电梯 程序架构 第一次题目非常简单,思考也非常简单,一部电梯傻瓜调度.将命令入公共的队列,电梯从公共队列中取命令即可,其中只需要使用ArrayBloc ...

  6. sass学习笔记(一)接上个 持续学习中..(还发现个讲解的bug) sass至少我现在学的版本支持局部变量了

    6.全局变量 sass暂时没有局部变量 局部定义变量会覆盖全局变量 新出!global 不过要sass 3.4版本以后        (这句呢,,我觉得是错的 开始写的时候没测试 现在发现我觉得他是有 ...

  7. MyBatis-day1

    Tips: 1, SQLSession通过SQLSessionFactory获得, SqlSessionFactory 的实例可以通过 SqlSessionFactoryBuilder 获得.有两种配 ...

  8. enquire.js-响应css媒体查询的轻量级javascript库

    轻量,没有依赖. 安装: npm install enquire.js API: enquire.register(mediaQuery, handler). mediaQuery: 字符串,需要响应 ...

  9. 新版ios证书的申请

    现在IOS不再开放提供测试证书了,整理一个申请证书的流程. 1. 申请应用的id 链接地址 https://developer.apple.com/登陆开发者中心,在account界面点击红框里面得区 ...

  10. cocso引擎整体流程

    任何程序都有入口,mian.cpp; Cocos2d也不免俗,在win32平台下,有一个mian.cpp 入口,从这里进入cocos的世界. #ifndef __MAIN_H__ #define __ ...