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. AtCoder ARC 090 E / AtCoder 3883: Avoiding Collision

    题目传送门:ARC090E. 题意简述: 给定一张有 \(N\) 个点 \(M\) 条边的无向图.每条边有相应的边权,边权是正整数. 小 A 要从结点 \(S\) 走到结点 \(T\) ,而小 B 则 ...

  2. Linux内核跟踪之syscall tracer 【转】

    转自:http://blog.chinaunix.net/uid-20543183-id-1930847.html ------------------------------------------ ...

  3. 高性能.NET MVC之QMVC!

    ASP.NET!这个词代表者一个单词Fat!因为他总是捆绑着太多的太多的类,太多太多的各种功能!你也许会用到,如果你反编译或阅读他们开源的源码,你会不会犹如在大海中找不到方向?不管是Web form ...

  4. torchvision简介

    安装pytorch时,torchvision独立于torch.torchvision包由流行的数据集(torchvision.datasets).模型架构(torchvision.models)和用于 ...

  5. 简易博客[ html + css ] 练习

    1. 前言 通过使用 html + css 编写一个简易的博客作为入门练习 2. 代码及实现 2.1 目录结构 2.2 代码部分 <!DOCTYPE html> <html lang ...

  6. Nginx - buffer缓冲区部分

    目录- 1. 前言- 2. 指令- 3. 原理及总结 1. 前言 关于缓冲,主要是合理设置缓冲区大小,尽量避免缓冲到硬盘 2. 指令 proxy_buffering 说明:proxy_bufferin ...

  7. django model常用字段类型

    摘自 http://www.cnblogs.com/wt869054461/p/4014271.html V=models.AutoField(**options) #int:在Django代码内是自 ...

  8. 如何把自己的wordpress网站移到本地修改

    有时候wordpress更换模板时,需要修改的地方很多,而且在线修改不是很好.只能把它移动到电脑本地进行修改了.这样修改好就可以直接套用到网站上了. 1.通过服务器控制面板或FTP整站打包,发送到你已 ...

  9. mysqlsla 安装

    tar -zxvf mysqlsla-2.03.tar.gz cd mysqlsla-2.03 perl Makefile.PLmake && make install BEGIN f ...

  10. loadrunner——常见函数

    loadrunner——常见函数 分类: LoadRunner 2012-04-11 20:41 703人阅读 评论(0) 收藏 举报 loadrunnersearchweb服务器脚本stringwe ...