Windows环境使用Nexus-3.x搭建Maven私服
2017-07-05 17:06
671 查看
本文主要讲解在Wiindows环境下搭建最新出的Nexus 3.x私服。
1、搭建私服的必要性
一般情况下,各个公司的开发团队为了提高开发效率,都会使用项目构建工具进行开发。常见的构建工具有Ant、Grandle和Maven等。而使用构建工具,一般情况下都需要管理各种依赖的插件,需要频繁连接服务器。而考虑到开发效率,就需要搭建私服。总体来说,使用私服具有以下的好处:节省外网带宽加速Maven构建,提高效率内部部署构件灵活的安全和权限管理其他优势2、Nexus安装和启动
常见的搭建私服的软件有:Apache基金会的Archiva——开源JFrog的Artifatory——核心开源Sonatype的Nexus——核心开源,具有社区版本免费使用。最流行的Maven仓库管理软件。由于本文针对的是Maven私服,因此使用Nexus3.x的社区版。2.1 环境准备
我的前期环境配置:(1)Windows7 x64系统(2)JDK1.8(3)Maven3最核心的是下载安装Nexus3.x,这里的具体版本是nexus-3.1.0-04。下载地址2.2 安装
Nexus3.x是免安装的,下载之后解压到一个文件夹NEXUS_HOME中。至此,下载安装完成。
2.3 Nexus端口配置
Nexus3.x的配置和Nexus1.x、Nexus2.x的配置完全不同。Nexus1.x、Nexus2.x的端口配置方法参考:http://jingyan.baidu.com/article/4853e1e5739e661909f72695.html而Nexus3.x的安装目录架构如图:"nexus-3.1.0-04"为Nexus3.x的安装文件目录,“sonatype-work”为Nexus3.x的工作(或称之为数据)目录。和以往不同的是,若想修改Nexus自带的Jetty容器的服务端口,需要修改“NEXUS_HOME\sonatype-work\nexus3\etc”目录下的“nexus.properties”配置文件,修改其中的端口即可。默认端口为:8081,但是通常该端口可能已经被占用,从而出现JettyServerFailed to Start的错误,抛出地址已经被占用的异常,无法绑定,从而导致错误。例如我这里端口改为:80832.4 Nexus运行
虽然在“NEXUX_HOME\nexus\nexus-3.1.0-04\bin”目录下存在nexus.exe的可执行程序,但是双击程序或者右键使用管理员运行,都不能启动Nexus的服务。正确的打开姿势是:通过命令行运行。执行步骤如下:Win+R,输入cmd回车,打开命令提示符窗口。一路cd命令,进入“NEXUX_HOME\nexus\nexus-3.1.0-04\bin”目录。输入 nexus,exe /run,回车即可运行。对于不熟悉命令提示符命令操作的用户,还有一种简单的打开命令提示符窗口的办法:进入“NEXUX_HOME\nexus\nexus-3.1.0-04\bin”目录。按住Shift键,同时鼠标右键单击,选择“在此处打开命令窗口”。输入 nexus,exe /run,回车即可运行。输入启动nexus的指令:nexus.exe /run出现如下的信息,表示启动成功。3 登录Nexus管理系统
Nexus的默认服务端口为8081,默认的用户名是:admin,密码:admin123。由于我修改了端口号为8083,打开浏览器,输入:localhost:8083即可进入Nexus管理系统。点击右上角的Sign in按钮,输入用户名和密码,进入仓库管理系统。4 仓库配置
仓库配置详见官方文档:http://books.sonatype.com/nexus-book/reference3/admin.html#admin-repositories<distributionManagement> <snapshotRepository> <id>nexus</id> <name>nexus</name> <url>http://localhost:8888/repository/maven-snapshots/</url> </snapshotRepository> <repository> <id>nexus</id> <name>nexus</name> <url>http://localhost:8888/repository/maven-releases/</url> </repository> </distributionManagement>
<profile> <id>nexus</id> <repositories> <repository> <id>nexus</id> <name>Nexus</name> <url>http://localhost:8888/repository/maven-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:8888/repository/maven-public/</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile>
<server> <id>nexus</id> <username>admin</username> <password>admin123</password> </server> <server> <id>releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>snapshots</id> <username>admin</username> <password>admin123</password> </server>
<mirror> <id>nexus</id> <mirrorOf>*</mirrorOf> <name>Nexus</name> <url>http://localhost:8888/repository/maven-public/</url> </mirror> </mirrors>
https://www.sonatype.com/download-oss-sonatype?hsCtaTracking=10655413-f621-4c62-be46-df84cf6b6b90%7C79f798b3-f0df-4370-b569-0eda6e14390e
相关文章推荐
- Windows环境使用Nexus-3.x搭建Maven私服
- Windows环境使用Nexus-3.x搭建Maven私服
- Windows环境使用Nexus-3.x搭建Maven私服
- Windows环境下使用Nexus 3.X 搭建Maven私服及使用介绍
- Windows环境使用Nexus-3.x搭建Maven私服
- windows环境使用 Nexus3.x 为 Android 搭建私服
- Linux环境使用Nexus搭建Maven私服
- Windows下使用Nexus搭建Maven私服(使用)
- windows下使用nexus搭建maven私服的流程和说明
- windows下集成maven+eclipse开发环境一:安装使用maven私服nexus
- windows下使用nexus搭建maven私服(二)
- windows下使用nexus搭建maven私服
- windows下使用nexus搭建maven私服(一)
- Linux 使用 Nexus3.x 搭建 Maven 私服指南
- maven私服nexus环境搭建以及使用
- maven使用nexus3.3在windows下搭建私服
- 使用Nexus搭建Maven私服(Windows版)
- windows下集成maven+eclipse开发环境一:安装使用maven私服nexus
- windows下使用nexus搭建maven私服的流程和说明
- 在操作系统Centos 6.3 上使用Nexus 2.8搭建MAVEN私服 及 cloudstack 开发环境