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. Word Ladder I & II

    Word Ladder I Given two words (start and end), and a dictionary, find the length of shortest transfo ...

  2. go 数组

    数组的定义和 初始化 数组是同一类型的元素集合 ]int //定义⼀个数组 Go中数组下标从0开始,因此长度为n的数组下标范围:[0,n-1] 整数数组中的元素默认初始化为0,字符串数组中的元素默认初 ...

  3. CNN细节

    1.各层作用 输入层 输入层是整个神经网络的输入,一般代表的是图片的像素矩阵(一般为三维矩阵,即像素x像素x通道) 卷积层 每一层卷积都会提取数据特征,再经过组合和抽象形成更高阶的特征. 池化层 保留 ...

  4. SQl查询数据库库名,表名、表的列名

    查询数据库 select * From master.dbo.sysdatabases where name='数据库名' and status<>512   --读取库中的所有表名 (当 ...

  5. C#socket编程序(三)

    private void ReceiveData() { bool keepalive = true; Socket s = clientSocket; Byte[] buffer = new Byt ...

  6. hdu 4642 翻硬币

    在一个n*m的棋盘上 每一个格子都有一枚硬币 1表示正面 0表示反面你每次可以选择一个硬币为正面的点,然后从该点与右下角点形成的矩阵硬币全都反向,直到一个人没有硬币可以选择则输Alice先手 列举了几 ...

  7. linux系统host修改

    有时候我们需要修改主机的host主机名,方便管理和识别自己的服务器,修改步骤如下: 第一步: vi  /etc/hosts 正常情况下,修改了第一步就可以了,如果通过hostname命令查看还是修改以 ...

  8. POJ - 1743 后缀自动机

    POJ - 1743 顺着原字符串找到所有叶子节点,然后自下而上更新,每个节点right的最左和最右,然后求出答案. #include<cstdio> #include<cstrin ...

  9. 利用过滤器对string类型的入参进行统一trim

    背景 最近做的一些项目都是后台管理系统,主要是对表单数据的增删改查操作,其中有些表单项是字符串类型的,对于这些类型的表单项就需要在保存或编辑之前要进行.trim()处理,刚开始感觉没什么,遇到了就手动 ...

  10. 使用Swing的JSpinner组件设置日期时间选择器

    代码: //获得时间日期模型 SpinnerDateModel model = new SpinnerDateModel(); //获得JSPinner对象 JSpinner year = new J ...