原文:http://blog.csdn.net/qqqqq210/article/details/52993337

1.简介

近期公司需要搭建jenkins自动化构建部署,需要搭建nexus私服环境,以便项目组的成员开发效率,以及打包发布,这样既节省了网络带宽也会加速项目搭建的进程, 当然前提条件就是你的私服中拥有项目所需的所有构件。

2.NEXUS下载(最新版3.1)

https://www.sonatype.com/download-oss-sonatype

3.安装

解压nexus-3.1.0-04-win64.zip, 
得到以下目录

1.nexus-3.1.0-04 nexus程序 
2.sonatype-work nexus工作目录 
(数据,备份nexus的时候可以备份这个文件夹)

nexus默认端口是8081

可以在nexus-3.1.0-04\etc\nexus-default.properties修改

配置系统环境变量

右击我的电脑-属性-高级-环境变量-系统变量区域(点击新增)

4.启动

cd nexus-3.1.0-04\bin目录下

常用命令
.nexus.exe /install 安装nexus为系统服务
.nexus.exe /uninstall 卸载nexus为系统服务
.nexus.exe /start 启动nexus服务
.nexus.exe /stop 停止nexus服务

启动后访问: http://127.0.0.1:8081/ 即可 
新版没用了项目名/nexus

默认登录: admin/admin123

登录之后才可以配置nexus私服

5.maven以及配置使用

no 废话,直接上配置 
1. 先在maven目录/conf/setting.xml的servers添加配置:

 <server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
  1. 工程中配置,发布/私服工厂
<!-- 配置私服工厂 -->
<repositories>
<repository>
<id>nexus</id>
<url>http://ip:8081/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<url>http://ip:8081/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<!-- 配置发布到私服 -->
<distributionManagement>
<repository>
<id>nexus</id>
<name>Nexus Release Repository</name>
<url>http://ip:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>Nexus Snapshot Repository</name>
<url>http://ip:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>

补充技巧

1.发布自定义jar到Nexus3

nexus 3.1版本去除了本地上传发布自定义jar

解决方案:
使用命令行进行本地jar上传 语法:
mvn deploy:deploy-file
-DgroupId=<group-id>\
-DartifactId=<artifact-id>\
-Dversion=<version>\
-Dpackaging=<type-of-packaging>\
-Dfile=<path-to-file>\
-DrepositoryId=<id-to-map-on-server-section-of-settings.xml>\
-Durl=<url-of-the-repository-to-deploy> 例子: mvn deploy:deploy-file -DgroupId=com.ojdbc7
-DartifactId=ojdbc7 -Dversion=1.0 -Dfile=ojdbc7.jar
-DrepositoryId=nexus -Durl=http://ip:prot/repository/maven-releases/

DrepositoryId=nexus指的是setting配置的验证的id

2.离线索引

参考博文:http://blog.csdn.net/lusyoe/article/details/52821088

由于使用代理之前需要先下索引,从国外下载的话非常的慢。可以翻墙或者可以使用常用的下载工具,下载后再上传到nexus服务器即可。 
http://repo.maven.apache.org/maven2/.index/ 找到需要下载的索引文件。 
如:http://repo.maven.apache.org/maven2/.index/nexus-maven-repository-index.gz 
还有 
http://repo.maven.apache.org/maven2/.index/nexus-maven-repository-index.properties 
将其上传到nexus服务器存储数据的仓库中,对应web管理界面上就是Repository/Blob Stores/仓库名。 
在我的服务器上地址是在/var/opt/nexus-data/blobs/仓库名。 
在仓库名目录下创建.index目录,然后将下载的文件copy到该目录中,之后很快就同步好了,同步完成状态可通过查看web管理界面仓库状态栏,当出现Online - Remote Aviailable时就表示已同步完成了。 

1.简介

近期公司需要搭建jenkins自动化构建部署,需要搭建nexus私服环境,以便项目组的成员开发效率,以及打包发布,这样既节省了网络带宽也会加速项目搭建的进程, 当然前提条件就是你的私服中拥有项目所需的所有构件。

2.NEXUS下载(最新版3.1)

https://www.sonatype.com/download-oss-sonatype

3.安装

解压nexus-3.1.0-04-win64.zip, 
得到以下目录

1.nexus-3.1.0-04 nexus程序 
2.sonatype-work nexus工作目录 
(数据,备份nexus的时候可以备份这个文件夹)

nexus默认端口是8081

可以在nexus-3.1.0-04\etc\nexus-default.properties修改

配置系统环境变量

右击我的电脑-属性-高级-环境变量-系统变量区域(点击新增)

4.启动

cd nexus-3.1.0-04\bin目录下

常用命令
1.nexus.exe /install 安装nexus为系统服务
2.nexus.exe /uninstall 卸载nexus为系统服务
3.nexus.exe /start 启动nexus服务
4.nexu

默认登录: admin/admin123

登录之后才可以配置nexus私服

5.maven以及配置使用

no 废话,直接上配置 
1. 先在maven目录/conf/setting.xml的servers添加配置:

nexus3.1私服搭建的更多相关文章

  1. Nexus3.0私服搭建

    官方文档:http://books.sonatype.com/nexus-book/3.0/reference/install.html 1.下载 http://www.sonatype.com/do ...

  2. maven windows环境nexus3.0私服搭建

    下载 nexus3.x.x 需要JDK1.8版本到sonatype官网下载开源免费的OSS版本,OSS即为Open Source Software.下载地址:https://www.sonatype. ...

  3. 【Maven】---Linux搭建Nexus3.X私服

    Linux搭建Nexus3.X私服 备注:linux版本: ubuntu 同时已经部署好JDK8环境 一.linux安装nexus 1.创建文件夹并进入该目录 cd /usr/local && ...

  4. docker私服搭建nexus3

    docker私服搭建有官方的registry镜像,也有改版后的NexusOss3.x,因为maven的原因搭建了nexus,所以一并将docker私服也搭建到nexus上. nexus的安装过程就单独 ...

  5. npm私服搭建

    本文是在 centos7 下利用 nexus 搭建 npm 私服的整理 一.安装 JDK 1.下载 JDK 2.安装 tar zxvf jdk-8u191-linux-x64.tar.gz .0_19 ...

  6. maven_nexus3私服搭建

    [maven_nexus3私服搭建] # 00.安装环境说明# (1)Windows7 64位# (2)JDK1.8 64位# (3)Sonatype Nexus Repository OSS 3.1 ...

  7. Maven 仓库搜索服务和私服搭建

    Maven 仓库搜索服务 使用maven进行日常开发的时候,一个常见问题就是如何寻找需要的依赖,我们可能只知道需要使用类库的项目名称,但是添加maven依赖要求提供确切的maven坐标,这时就可以使用 ...

  8. 温故知新,基于Nexus3和Docker搭建私有Docker Mirrors镜像库

    前言 接着上一篇文章关于基于Nexus3和Docker搭建私有Nuget服务的探索,我们可以进一步利用Nexus3来创建一个私有的Docker镜像库满足内部需求. 仓库类型 hosted: 本地存储, ...

  9. maven私服搭建

    一.软件安装 地址:http://www.sonatype.org/nexus/thank-you-for-downloading/?dl=tgz 解压: 启动: >> nexus sta ...

随机推荐

  1. Window.Event.KeyCode的含义

    Window.Event.KeyCode=13的含义(转载) 2011-04-16 09:41:18|  分类: html |  标签:keycode  event  realkey  var  do ...

  2. type和isinstance区别

    type只能对类型做直接的判断,主要用于获取未知变量的类型. 在程序中几乎很少用到type. 而isinstance功能比type更强,可以对子类型做出推理判断. isinstance主要用于判断A是 ...

  3. 简洁的KVO -- 使用Block响应事件

    涉及内容: KVO,Runtime,Category,Block 首先创建NSObject的Category 举个例子是这样的: 随后定义你需要响应的Block结构 我简单一点就这样咯 typedef ...

  4. Mac 查看端口情况

    一个进程可以占用多个端口. 查看某个进程占用哪些端口: lsof -nP | grep TCP | grep -i 进程名 ➜ cocos_creator lsof -nP | grep TCP | ...

  5. 【原创翻译】链接DLL至可执行文件---翻译自MSDN

    可执行文件.exe链接(或加载)DLL有以下两种形式: 隐式链接 显式链接 隐式链接是指静态加载或在程序加载时动态链接. 通过隐式链接,在使用DLL时,可执行文件链接到一个由生成DLL的人提供的导入函 ...

  6. RTSP详解

    关于 RTSP. RTSP协议是一个非常类似HTTP协议的流控制协议.它们都使用纯文本来发送信息,而且rtsp协议的语法也和HTTP类似.Rtsp一开始这样设计,也是为了能够兼容使用以前写的HTTP协 ...

  7. centos 7 安装 docker(详细)

    更新源 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup wget -O/etc/yum.re ...

  8. SQL的几种连接

    1. 内连接 结果: 从左表中取出每一条记录,去右表中与所有的记录进行匹配: 匹配必须是某个条件是左表中与右表中相同,才会保留结果,否则不保留: 1.等值连接:在连接条件中使用等于号(=)运算符比较被 ...

  9. docker快速搭建

    curl  -sSL https://get.docker.com|sh docker --version systemctl start docker.service ps -ef|grep doc ...

  10. LeetCode(19) Remove Nth Node From End of List

    题目 Given a linked list, remove the nth node from the end of list and return its head. For example, G ...