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.配置环境变 ...
随机推荐
- Python语言学习:homework2
三级菜单 # Author:Crystal data = { '北京':{ "昌平":{ "沙河":["oldbay","test ...
- mybatis的XML配置文件中,typeHandler、jdbcType、javaType的使用
1.前言 typeHandler.jdbcType.javaType都是用来处理java数据类型和jdbc数据库数据类型的转换问题,但在xml的不同位置使用需要注意引号使用问题. 2.在xml的不同位 ...
- npm安装依赖报 npm ERR! code Z_BUF_ERROR npm ERR! errno -5 npm ERR! zlib: unexpected end of file 这个错误解决方案
今天碰到了一个比较奇怪的问题,下载依赖有问题报错 npm ERR! code Z_BUF_ERROR npm ERR! errno -5 npm ERR! zlib: unexpected end o ...
- Python笔记_第一篇_面向过程_第一部分_5.Python数据类型之字典类型(dict)
字典!在Python中字典是另一种可变容器模型,可以存储任意类型的对象.是Python存储数据类型的最高级(maybe). 特点:1. 字典的存储方式和其他类型数据略有不同,是通过键(key)和值(v ...
- 17.3.15---关于GPIO控制流水灯的信息
添加一个网址: http://rmingwang.com/gpio-control-flow-lamp-code-archive.html 还有一个 http://www.openedv.com/po ...
- 14 微服务电商【黑马乐优商城】:day03-springcloud(Hystix,Feign)
本项目的笔记和资料的Download,请点击这一句话自行获取. day01-springboot(理论篇) :day01-springboot(实践篇) day02-springcloud(理论篇一) ...
- mysql之存储过程(二)
1.批量根据复杂的SQL查询结果插入到新表 DELIMITER && CREATE PROCEDURE settlePADTEST() begin DECLARE c_s ...
- linux中常见压缩文件格式
文件后缀名 说明 *.zip zip 程序打包压缩的文件 *.rar rar 程序压缩的文件 *.7z 7zip 程序压缩的文件 *.tar tar 程序打包,未压缩的文件 *.gz gzip 程序( ...
- winform把所有dll打包成一个exe
大家都知道做winform开发,是可以利用visual studio进行打包的,但是这种打包的方式需要双击安装,那么有没有什么方法,可以把winform程序打包成绿色版呢?当然,这里的“绿色版”也是相 ...
- js 实现时间递增,当前时间功能,javascript格式化当天日期
直接上代码: function nowTimeStr() { var date = new Date(); ...