1 下载nexus安装包  网址:http://www.sonatype.org/nexus/
   建议下载最新的版本,最新的版本支持比较新的jdk版本, 1.6 肯定是不行的,必须是1.7及其以上。

下载所需安装包。http://pan.baidu.com/s/1ntzDWkL
如果读者已经设置jdk 版本,且低于1.7. 则可以配置想要使用的 jdk 版本。 nexus-2.10.0-02\bin\jsw\conf, 目录 wrapper.conf 文件 ,
找到 wrapper.java.command= F:/jdk1.7.0_71/bin/java.exe, 这样配置即可。
2 启动nexus服务
找到当前对应的版本,有32, 64 位。
    进入nexus的文件目录:..\nexus-2.10.0-02\bin\jsw\windows-x86-64下面,
      Installnexus.bat 表示安装nexus服务到window服务中去。
      Startnexus.bat  表示启动nexus服务。
      nexus.bat  表示启动nexus应用程序 。
      Resumenexus.bat  表示重启nexus 。
      Stopnexus.bat  表示停止nexus服务
   启动nexus 无需启动tomcat,只需要点击“nexus.bat "就可以启动。
   启动成功后 在浏览器地址栏中输入:
   http://localhost:8081/nexus/index.html
   如果看到nexus界面 说明启动成功。
3 设置maven的setting.xml文件
   3.1 设置自定义的仓库
   默认仓库会保存在c盘的C:\Users\yjx\.m2下面,如果要使用自定义的仓库,则在setting.xml中添加下面的配置

<localRepository>e:/repository</localRepository>

3.2 设置镜像私服

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

<mirrors>

<!-- mirror

| Specifies a repository mirror site to use instead of a given repository. The repository that

| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used

| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.

|-->

<mirror>

<id>nexus</id>

<mirrorOf>*</mirrorOf>

<name>Nexus Mirror</name>

<url>http://localhost:8081/nexus/content/groups/public</url>

</mirror>

</mirrors>

3.3 设置 profile

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

<profile>

<id>nexus</id>

<repositories>

<repository>

<id>nexus</id>

<name>Nexus</name>

<url>http://localhost:8081/nexus/content/groups/public</url>

<releases><enabled>true</enabled></releases>

<snapshots><enabled>true</enabled></snapshots>

</repository>

</repositories>

<pluginRepositories>

<pluginRepository>

<id>nexus</id>

<name>Nexus</name>

<url>http://localhost:8081/nexus/content/groups/public</url>

<releases><enabled>true</enabled></releases>

<snapshots><enabled>true</enabled></snapshots>

</pluginRepository>

</pluginRepositories>

</profile>

<!--激活配置-->

<activeProfiles>

<activeProfile>nexus</activeProfile>

</activeProfiles>

保存文件。

4 登录nexus  用户名admin  密码 admin123.

进入Repository菜单,修改 Apache Snapshots,Codehaus Snapshots,Maven Central的Download Remote indexs 为true.

并右击每一个仓库的 repair Index  ,进行更新index  并把所有的proxy类型的仓库添加到public repository中去。

自己觉得比较好的其他的代理仓库如下:

添加新的repository 即代理仓库, 代理仓库的remoteurl

http://repository.jboss.org/nexus/content/groups/public/

https://repository.jboss.org/nexus/content/groups/developer/

6 备注

如果你安装的jdk是1.7的版本或者更高,请使用nexus版本2.0以上的版本

7 nexus 服务器的迁移

nexus 他本身会吧要下载好的jar 包存储起来,下次就不会再去下载。

他的storage 存储目录是: sonatype-work\nexus\storage

sonatype-work 这个目录和 nexus 是同级的,nexus-2.10.0-02 与   onatype-work 在同一目录下,是自动创建的,迁移的时候只需要拷贝这些 storage 过去就可以了。

搭建Nexus本地仓库的更多相关文章

  1. 使用Nexus搭建Maven本地仓库

    阅读目录 序 Nexus 本文版权归mephisto和博客园共有,欢迎转载,但须保留此段声明,并给出原文链接,谢谢合作. 文章是哥(mephisto)写的,SourceLink 序 在工作中可能存在有 ...

  2. nexus 搭建maven本地仓库

    使用Nexus搭建Maven本地仓库   阅读目录 序 Nexus 序 在工作中可能存在有些开发机器不能上网,大量的机器获取jar包会导致公司网络很慢,还有时候公司会自己发布自己的项目版本,其他的项目 ...

  3. Linux 用脚本编写搭建yum本地仓库

    Linux 用脚本编写搭建yum本地仓库 源码如下: #!/bin/bash #该脚本用于自动化搭建本地yum仓库 #挂载光盘 #作者:雨中落叶 #博客:https://www.cnblogs.com ...

  4. 搭建YUM本地仓库

    本文介绍如何利用CentOS 7 ISO光盘镜像搭建YUM本地仓库. 环境准备: (1)VMware15.5版本虚拟机 (2)CentOS-7-x86_64-DVD-1908光盘镜像文件 1. 搭建Y ...

  5. maven上传jar到nexus本地仓库

    一.nexus新增本地仓库 Hosted Repository:本地仓库,部署组织内部的版本内容 Proxy Repository:代理仓库,代理远程的公共仓库,如maven中央仓库 Virtual ...

  6. 搭建maven本地仓库,idea应用本地maven仓库

    提环境: 安装好tomcat.maven.jdk.idea. 打开maven安装目录,在目录下新建 maven仓库文件夹(名子随便): 打开conf\setting.xml 加入<localRe ...

  7. 使用 satis 搭建 composer 本地仓库

    环境 windows nginx php composer 安装 拉取 satis 项目包,并拉取项目依赖 composer create-project composer/satis --stabi ...

  8. Maven搭建Nexus私有仓库

    下载压缩包nexus-2.13.0-01-bundle.tar.gz 解压后有两个目录 进入程序目录启动 ./nexus start 启动告警(确认用root启动把以下加入到环境变量) export ...

  9. 使用Nexus2搭建Maven本地仓库

    由于OS为WindowsXP,而Nexus3forWindows为x64版本,只能选择安装nexus2了. Windows(x86)平台,Nexus Repository Manager OSS 2. ...

随机推荐

  1. 【codeforces】【比赛题解】#864 CF Round #436 (Div.2)

    做出了4题,还不错,可惜还是掉rating……能保持在蓝名已经不错了. 题目跳转链接. [A]公平的游戏 题意: Petya和Vasya在玩游戏.他们有n张卡片(n是偶数).每张卡片上有一个整数. 游 ...

  2. angular select ng-change实时获取value

    <select ng-model="vm.selectVal" ng-options="o.id as o.title for o in vm.optionsDat ...

  3. 85.YCbCr与YUV的区别

    yuv色彩模型来源于rgb模型,该模型的特点是将亮度和色度分离开,从而适合于图像处理领域. YCbCr模型来源于yuv模型,应用于数字视频,ITU-R BT.601 recommendation 通过 ...

  4. 170406回顾-SQL Server的smalldatetime类型比较

    在比较SQL Server的类型为smalldatetime字段时出现下面的错误:将 expression 转换为数据类型 smalldatetime 时出现算术溢出错误 正确的比较方法如下:将lon ...

  5. urllib2使用初探

    在入门urllib2之前,我想应该先调研一下urllib与urllib2的区别[1].首先我们要明白的是,这两个模块不可以相互替代.两者都是接受URL请求的模块,但是提供了不同的功能,两个显著的区别是 ...

  6. 用js面向对象思想封装插件

    js是基于原型的面向对象语言,如果你学过java,c#等正统面向对象语言,你会难以理解js的面向对象,他和普通的面向对象不太一样,今天,我们通过封装一个toast插件,来看看js面向对象是如何运行的. ...

  7. 网络协议之NAT穿透

    NAT IPv4地址只有32位,最多只能提供大致42.9亿个唯一IP地址,当设备越来越多时,IP地址变得越来越稀缺,不能为每个设备都分配一个IP地址.于是,作为NAT规范就出现了.NAT(Networ ...

  8. tensorflow高级库

    1.tf.app.flags tf定义了tf.app.flags,用于支持接受命令行传递参数,相当于接受argv.tf.app.flags.DEFINE_xxx()就是添加命令行的optional a ...

  9. Codeforces 988F Rain and Umbrellas(DP)

    题目链接:http://codeforces.com/contest/988/problem/F 题目大意: 有三个整数a,n,m,a是终点坐标,给出n个范围(l,r)表示这块区域下雨,m把伞(p,w ...

  10. tomcat 内存参数优化示例

    https://www.cnblogs.com/cornerxin/p/9304100.html