搭建Nexus本地仓库
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本地仓库的更多相关文章
- 使用Nexus搭建Maven本地仓库
阅读目录 序 Nexus 本文版权归mephisto和博客园共有,欢迎转载,但须保留此段声明,并给出原文链接,谢谢合作. 文章是哥(mephisto)写的,SourceLink 序 在工作中可能存在有 ...
- nexus 搭建maven本地仓库
使用Nexus搭建Maven本地仓库 阅读目录 序 Nexus 序 在工作中可能存在有些开发机器不能上网,大量的机器获取jar包会导致公司网络很慢,还有时候公司会自己发布自己的项目版本,其他的项目 ...
- Linux 用脚本编写搭建yum本地仓库
Linux 用脚本编写搭建yum本地仓库 源码如下: #!/bin/bash #该脚本用于自动化搭建本地yum仓库 #挂载光盘 #作者:雨中落叶 #博客:https://www.cnblogs.com ...
- 搭建YUM本地仓库
本文介绍如何利用CentOS 7 ISO光盘镜像搭建YUM本地仓库. 环境准备: (1)VMware15.5版本虚拟机 (2)CentOS-7-x86_64-DVD-1908光盘镜像文件 1. 搭建Y ...
- maven上传jar到nexus本地仓库
一.nexus新增本地仓库 Hosted Repository:本地仓库,部署组织内部的版本内容 Proxy Repository:代理仓库,代理远程的公共仓库,如maven中央仓库 Virtual ...
- 搭建maven本地仓库,idea应用本地maven仓库
提环境: 安装好tomcat.maven.jdk.idea. 打开maven安装目录,在目录下新建 maven仓库文件夹(名子随便): 打开conf\setting.xml 加入<localRe ...
- 使用 satis 搭建 composer 本地仓库
环境 windows nginx php composer 安装 拉取 satis 项目包,并拉取项目依赖 composer create-project composer/satis --stabi ...
- Maven搭建Nexus私有仓库
下载压缩包nexus-2.13.0-01-bundle.tar.gz 解压后有两个目录 进入程序目录启动 ./nexus start 启动告警(确认用root启动把以下加入到环境变量) export ...
- 使用Nexus2搭建Maven本地仓库
由于OS为WindowsXP,而Nexus3forWindows为x64版本,只能选择安装nexus2了. Windows(x86)平台,Nexus Repository Manager OSS 2. ...
随机推荐
- CertUtil.exe被利用来下载恶意软件
1.前言 经过国外文章信息,CertUtil.exe下载恶意软件的样本. 2.实现原理 Windows有一个名为CertUtil的内置程序,可用于在Windows中管理证书.使用此程序可以在Windo ...
- WCF ServiceContract,OperationContract
代码如下 [ServiceContract] //服务协定定义 using System.ServiceModel; public interface IInterface1 { [Operation ...
- spark技术总结(1)
1. 请描述spark RDD原理与特征 RDD为Resilient Distributed Datasets缩写,译文弹性分布式数据集. 他是spark系统中的核心数据模型之一,另外一个是DAG模型 ...
- 孤的Scrapy官文阅读进程
上月底开始学习Scrapy爬虫框架,看了一些中文文档,讲应用.讲基础的,对其有一些了解了.终于在28日打开Scrapy的官网,并制作了其文档的思维导图,进而开启了其文档的阅读之旅. 本文展示了从6月2 ...
- C压缩字符串中的空格
使用纯C语言,去除一个字符串开头和结尾的空格,内部若有连续空格只保留一个. C Code 12345678910111213141516171819202122232425262728293031 ...
- Python 安装 pytesser 处理验证码出现的问题
今天这个问题困扰了我好久,开始直接用 pip install pytesseract 安装了 pytesseract 然后出现了如下错误 Traceback (most recent call las ...
- vector 测试
vector 测试 */--> div.org-src-container { font-size: 85%; font-family: monospace; } pre.src { backg ...
- 安装SHARP MX-3618NC PCL6打印机驱动程序
第一步, 打开MX-CR3_PCL_PS_1302a_ChineseS_Win8Server2012.exe 驱动程序 此驱动支持Win8.Server2012及以下版本的操作系统,同时兼容Win1 ...
- 【PAT】1017 A除以B(20 分)
1017 A除以B(20 分) 本题要求计算 A/B,其中 A 是不超过 1000 位的正整数,B 是 1 位正整数.你需要输出商数 Q 和余数 R,使得 A=B×Q+R 成立. 输入格式: 输入在一 ...
- pyqt5猜数小程序
程序界面用qt设计师制作,并用pyuic5命令转换成form.py文件 #-*- coding:utf-8 -*- from PyQt5.QtWidgets import QApplication,Q ...