mac安装并配置nexus3.5.1版本
一、安装nexus
前置条件 :已经安装了JDK
1:下载nexus(http://www.sonatype.com/download-oss-sonatype) 最新版本(我的是3.5.1).
2:解压下载文件,我的放在了/Users/xxx/myApp下
3:配置环境变量:
打开/etc目录,在profile文件中加入:NEXUS_HOME="/Users/xxx/myApp/nexus-3.5.1-02-mac/nexus-3.5.1-02";
保存,退出后。打开控制台键入nexus start 即可启动(注:配置完环境变量后,控制台需要重启,再打开.)
如果不清楚命令,输入nexus,系统会给出命令使用说明
Usage: /Users/xxx/myApp/nexus-3.5.1-02-mac/nexus-3.5.1-02/bin/nexus {start|stop|run|run-redirect|status|restart|force-reload}
4:启动后,neuxs默认监听端口是8081。
在浏览器输入http://127.0.0.1:8081/nexus或者http://localhost:8081/nexus
出现下面这个界面,没关系,点击nexus repo..图标,跳转到下一个界面。


5、新搭建的neuxs环境只是一个空的仓库,需要手动和远程中心库进行同步。
nexus默认是关闭远程索引下载,最重要的一件事情就是开启远程索引下载。
登陆nexus系统,默认用户名密码为admin/admin123。
Nexus 的仓库分为这么几类:
- hosted 宿主仓库:主要用于部署无法从公共仓库获取的构件(如 oracle 的 JDBC 驱动)以及自己或第三方的项目构件;
- proxy 代理仓库:代理公共的远程仓库;
- virtual 虚拟仓库:用于适配 Maven 1;
- group 仓库组:Nexus 通过仓库组的概念统一管理多个仓库,这样我们在项目中直接请求仓库组即可请求到仓库组管理的多个仓库。
二、在maven中配置自己的私服
1:打开~/.m2/ settings.xml
1)配置下载文件保存路径, 这里也可以使用默认的,不用配置.
<localRepository>/Users/xxx/repository</localRepository>
2) 增加server节点
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
3)添加镜像地址
<mirror>
<id>nexus</id>
<mirrorOf>nexus-snapshots</mirrorOf>
<url>http://127.0.0.1:8081/repository/maven-public/</url>
</mirror>
4)添加profile
<profiles>
<profile>
<!--profile的id-->
<id>nexus</id>
<repositories>
<repository>
<!--仓库id,repositories可以配置多个仓库,保证id不重复-->
<id>nexus-releases</id>
<!--仓库地址,即nexus仓库组的地址-->
<url>http://127.0.0.1:8081/repository/maven-releases</url>
<!--是否下载releases构件-->
<releases><enabled>true</enabled></releases>
<!--是否下载snapshots构件-->
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>nexus-snapshots</id>
<url>http://127.0.0.1:8081/repository/maven-snapshots</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<!-- 插件仓库,maven的运行依赖插件,也需要从私服下载插件 -->
<pluginRepository>
<!-- 插件仓库的id不允许重复,如果重复后边配置会覆盖前边 -->
<id>nexus-releases</id>
<url>http://127.0.0.1:8081/repository/maven-releases</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
<pluginRepository>
<id>nexus-snapshots</id>
<url>http://127.0.0.1:8081/repository/maven-snapshots</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles> <!--使用profile定义仓库需要激活才可生效,切记:一定要激活,否则每次都是从https://repo.maven.apache.org/maven2这个网站下,私服根本没生效,我就吃了这个亏!-->
<activeProfiles>
<activeProfile>nexus</activeProfile><!--nexus和之上的id保持一致-->
</activeProfiles>
三、上传jar包到私服nexus
在pom.xml文件中加入:
<!-- 上传jar包到私服 -->
<distributionManagement>
<!-- 两个ID必须与 setting.xml中的<server><id>nexus-releases</id></server>保持一致 -->
<repository>
<id>nexus-releases</id>
<name>Nexus Release Repository</name>
<url>http://127.0.0.1:8081/repository/maven-releases/</url>
</repository> <snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://127.0.0.1:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
执行:
mvn package
mvn deploy -X
这时在以下这两个界面,将会看到(我的项目名叫lion):


mac安装并配置nexus3.5.1版本的更多相关文章
- Vsftpd 2.2.x安装和配置--centos7前的版本
Vsftpd 2.2.x安装和配置--centos7前的版本 原文链接:https://my.oschina.net/loubobooo/blog/1633367 1. 关闭防火墙和Selinux L ...
- mac 安装 python 配置||虚拟环境
前篇:http://www.cnblogs.com/ostrich-sunshine/p/8747791.html 介绍了 Mac 下 python 的一些相关知识. 这篇介绍 python3 的安装 ...
- Linux环境——MySQL安装及配置(8.0版本)
虚拟机环境是Linux Red Hat Enterprlse Linux (64位),本次安装的是Mysql 8.0版本. 由于有经验了,所以又弄了台虚拟机练手,承接上一篇博客(https://ww ...
- 全网最详细的大数据集群环境下如何正确安装并配置多个不同版本的Cloudera Hue(图文详解)
不多说,直接上干货! 为什么要写这么一篇博文呢? 是因为啊,对于Hue不同版本之间,其实,差异还是相对来说有点大的,具体,大家在使用的时候亲身体会就知道了,比如一些提示和界面. 全网最详细的大数据集群 ...
- mac 安装 tomcat 配置
前面的话:记录下 Mac 安装配置 Tomcat 过程 1. 下载安装 Tomcat 下载 Tomcat 地址(官方地址):https://tomcat.apache.org/download-80. ...
- Linux环境——MySQL安装及配置(5.7版本)
数据库安装包下载地址:https://dev.mysql.com/downloads/mysql/ 我的环境是Linux Red Hat Enterprlse Linux (64位),本次安装的是M ...
- mac 安装 maven 配置
前面的话: 记录 在 Mac 下 安装配置 maven 1. 下载 Maven, 并解压到某个目录.例如/Users/robbie/apache-maven-3.3.3 2. 打开 Terminal, ...
- mac 安装 java 配置
在mac电脑上开发java,需要配置java环境变量,mac不同于windows系统.不过呢,配置流程也相对简单. 安装jdk 首先查看,电脑上是否装了jdk. 在终端输入 java -versio ...
- Mac安装和配置Maven 及其第二次启动报错问题解决
1.下载安装 下载地址: https://maven.apache.org/download.cgi 下载后解压下来重名名为ApacheMaven,并放入到/usr/local/下 2.配置环境变 ...
随机推荐
- 业内首发 | 区块链数据服务 - BDS
区块链数据服务(Blockchain Data Service,BDS)是京东云区块链产品部发推出的,其将区块链的链式.非结构化数据通过技术手段进行结构化存储,实时同步到高性能数据仓库中. 用户可以通 ...
- 吴裕雄--天生自然TensorFlow高层封装:Estimator-自定义模型
# 1. 自定义模型并训练. import numpy as np import tensorflow as tf from tensorflow.examples.tutorials.mnist i ...
- 吴裕雄--天生自然 PYTHON3开发学习:列表
list1 = ['Google', 'Runoob', 1997, 2000]; list2 = [1, 2, 3, 4, 5 ]; list3 = ["a", "b& ...
- 01 语言基础+高级:1-2 面向对象和封装_day06【类与对象、封装、构造方法】
day06[类与对象.封装.构造方法] 面向对象类与对象三大特征——封装构造方法 能够理解面向对象的思想能够明确类与对象关系能够掌握类的定义格式能够掌握创建对象格式,并访问类中的成员能够完成手机类的练 ...
- react-native屏幕适配
写一个屏幕适配类文件AdapterUtil.js,这样避免每次进行单位换算 "use strict" import {Dimensions, StatusBar, Platform ...
- Linux(CENTOS7) Mysql不能远程连接解决办法
今天,在腾讯云的服务器上面装了一个Mysql,装完发现我在linux下面可以连接,但是在我的window下面是用mysql可视化工具(SQLyog)连接不了,错误如下: Host ‘’ is not ...
- python中__call__方法
在 Python 中提供了__call__ 方法,允许创建可调用的对象(实例).如果类中实现了 __call__ 方法,则可以像使用函数一样使用类. 例如简单的封装一个接口 get/post 方法: ...
- linux epoll 任务队列多线程模型
/* * *EPOLL ET 触发必须使用非阻塞,LT触发可以阻塞/非阻塞. *read 函数 非阻塞读需 忙轮寻 soket关闭返回0,循环读完数据 *如果已经读完再读read返回 -1,errno ...
- raw_input|active:|continue|break|
a = "please" b = "say something:" c =a+b m = 0 a = True while a: m = int(raw_inp ...
- soupUI解决md5加密签名,cookie传递
问题详情: 1.接口调用需要前提状态:登录状态(cookie) 2.接口请求需要签名,签名规则为:MD5(TokenKey+apikey+timestamp+nonc) 其中 1.TokenKey.a ...