一、前言
为什么要在本地开发机器上安装nexus?首先声明公司内部是有自己的nexus仓库,但是对上传jar包做了限制,不能畅快的上传自己测试包依赖。于是就自己在本地搭建了一个nexus私服,即可以使用公司nexus私服仓库中的依赖,也可以上传和使用自己的测试包依赖。
二、nexus下载
三、解压
将下载的nexus-3.14.0-04-win64.zip解压到自定义目录即可。
四、配置nexus的端口和上下文路径
打开zip解压文件下的 ../nexus-3.14.0-04-win64/nexus-3.14.0-04/etc/nexus-default.properties。
如下属性可以自定义修改。
application-host : Nexus服务监听的主机
application-port: Nexus服务监听的端口,
nexus-context-path : Nexus服务的上下文路径
通常可以不做任何修改,但个人习惯于修改 application-host 为127.0.0.1(关于0.0.0.0与127.0.0.1的区别自行检索),我这里只修改了端口。
五、运行环境配置
打开解压目录下的 ../nexus-3.14.0-04-win64/nexus-3.14.0-04/bin/nexus.vmoptions
可以在下图配置运行时的最大堆、最小堆等,可以根据个人的电脑以及需要修改,默认配置如下。
六、nexus安装
在.../nexus-3.14.0-04-win64/nexus-3.14.0-04/bin 目录下,以管理员身份运行cmd
1. nexus.exe /run 命令可以启动nexus服务(参考官方文档)
2. 安装nexus本地服务来启动(推荐使用这种方式,参考官方文档),命令如下所示。
nexus.exe /install <optional-service-name> //安装nexus服务
nexus.exe /install <optional-service-name> //安装nexus服务
七、启动/关闭nexus服务
nexus.exe /start <optional-service-name> //启动nexus服务
nexus.exe /stop <optional-service-name> //停止nexus服务
八、登录
默认的用户名和密码分别是:admin/amdin123
如果没有做任何端口和上下文路径的修改,直接访问 http://localhost:8081即可。
十、分组仓库的使用
settings文件如下:
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
| This is the configuration file for Maven. It can be specified at two levels:
|
| 1. User Level. This settings.xml file provides configuration