nexus 3.x私服配置(windows版)

### 前提:

 > 最近一直在做SDK开发,因为SDK是给特定的用户服务的,所以需要对SDK的安全性慎重考虑。之前一直在 [JitPack](https://jitpack.io/)上面发布私有库,让用户可以很方便的集成。但是,JitPack有时间限制。所以,就萌生了自己搭建私服的想法。刚好,今天刚配置起来,趁热打铁顺便撸一篇文章,既是给自己做一个笔记。也是为了给不太明白的小伙伴讲解一下,不足之处还望大佬指正。

### 首先
  话不多说,直接开始配置。首先,需要到[nexus官网](https://www.sonatype.com/download-oss-sonatype)下载文件,如下图所示
![nexus地址.png](https://upload-images.jianshu.io/upload_images/1716569-1bcdefd1c36269d9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)


![nexus版本选择.png](https://upload-images.jianshu.io/upload_images/1716569-07cfc908851f24fc.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![nexus文档.png](https://upload-images.jianshu.io/upload_images/1716569-b4d05460b0b51705.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

### 其次
+ 1、 nexus下载下来后就是配置了,先解压到指定文件夹下,我这里是放到__E:\programFiles\nexus__文件夹下的,解压文件,进入到__E:\programFiles\nexus\nexus-3.18.1-01\bin__文件夹下,将,E:\programFiles\nexus\nexus-3.18.1-01\bin添加到Path环境变量中,如下图所示
![nexus路径.png](https://upload-images.jianshu.io/upload_images/1716569-66f441750f6cc120.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
+ 2、打开命令行窗口,跳转到E:\programFiles\nexus\nexus-3.18.1-01\bin路径下,并且执行,nexus.exe/start命令,如下图所示,这样就成功了。然后,在浏览器输入[http://localhost:8081/](http://localhost:8081/) 默认8081端口,就ok了,如下图所示,__因为我这里改了默认端口和密码,所以端口不一样__
![nexus页面.png](https://upload-images.jianshu.io/upload_images/1716569-14399dc63d8b3b40.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

### 再次
  > 再讲两点,关于密码和默认端口的
+ 1、网上大部分博客都会讲默认的用户名和密码分别是admin和admin123。但是,如果你在3.x上面直接输入是进不去的。会有一个Incorrect username or password, or no permission to use the application.错误提示,如下图所示:
![nexus密码错误提示.png](https://upload-images.jianshu.io/upload_images/1716569-eb6478948fd9f8ef.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
至于怎么解决呢?来,看这边,当nexus解压之后会有两个文件夹__nexus3.x__和__sonatype-work__, __默认的密码__在__sonatype-work__文件夹下,会有一个__admin.password__的文件,里面就是默认的密码,复制即可,然后输入用户名:admin,密码:就是复制的那一串数字字母组合的东东。进去之后会让你更改密码,改成你自己的密码即可。
+ 2、修改默认的端口
  在你的nexus路径下的etc文件夹下的nexus-default.properties里面修改,我这里的路径是E:\programFiles\nexus\nexus-3.18.1-01\etc,打开nexus-default.properties文件,如下图所示,修改默认端口8081为8092即可。

  ![nexus默认端口.png](https://upload-images.jianshu.io/upload_images/1716569-fb3b45b42720d7a0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![nexus默认端口修改.png](https://upload-images.jianshu.io/upload_images/1716569-415780963f55057e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
### 最后
  本来想着以后再做这件事(其实是想偷懒,拖延症可不太好)。但是,想着既然想了,那么直接就开始做。所以有了这么一篇文章,后续会加入maven配置等文章。嗯,如果有不懂的地方可以加群(493180098),我们共同探讨一下。
### 感谢

[使用nexus3.10搭建maven私有仓库](https://blog.youkuaiyun.com/vipbupafeng/article/details/80232566)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值