nexus2安装与使用

news/2025/3/4 12:55:31/

nexus2安装与使用

文章目录

  • nexus2安装与使用
    • 一、nexus2安装包安装
      • 1.下载
      • 2.安装与运行
      • 3.Windows安装
        • (1)下载好nexus安装包,并解压到指定(任意)目录
        • (2)启动nexus
        • (3)访问
    • 二、docker安装
      • 必须环境
      • docker访问不到外网
      • docker能正常访问外网
        • 查询镜像
      • 安装镜像
    • 三、导入jar包
      • 手动将文件上传到nexus的存储库下
      • 删除多余的文件
      • 引用私服

一、nexus2安装包安装

1.下载

nexus2下载地址: https://help.sonatype.com/repomanager2/download

2.安装与运行

可以参考 https://help.sonatype.com/repomanager2/installing-and-running 即可

3.Windows安装

(1)下载好nexus安装包,并解压到指定(任意)目录

​ 我的安装目录E:\apps\nexus-2.14.11-01\bin

(2)启动nexus

E:\apps\nexus-2.14.11-01\bin>nexus.bat console

(3)访问

启动成功后访问 http://localhost:8081/nexus

在这里插入图片描述

至此安装成功

可以使用默认的用户名密码登录管理nexus

用户名 admin

密码 admin23

二、docker安装

必须环境

已安装了docker

docker访问不到外网

访问不到外网需要使用私服安装,私服必须有对应的镜像。
命令

docker run -d --name=my_nexus -v /home/docker/docker_storage/nexus/nexus-data2:/sonatype-work -p 8081:8081 192.168.1.166:5000/sonatype/nexus:oss

私服镜像地址:192.168.1.166:5000/sonatype/nexus:oss
–name=my_nexus 启动的容器名
/home/docker/docker_storage/nexus/nexus-data2为存放nexus的jar包持久化文件夹

访问不到外网的错误信息

[root@docker171 ~]# docker search nexus
Error response from daemon: Get https://index.docker.io/v1/search?q=nexus: dial tcp: lookup index.docker.io on [::1]:53: read udp [::1]:34373->[::1]:53: read: connection refused

docker能正常访问外网

查询镜像

docker search nexus目前默认列出的是nexus3

[root@docker136 ~]# docker search nexus
NAME                                         DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
sonatype/nexus3                              Sonatype Nexus Repository Manager 3             539                                     
sonatype/nexus                               Sonatype Nexus                                  408                                     [OK]
sonatype/docker-nexus3                       Sonatype Nexus 3 [DEPRECATED]                   32                                      [OK]
clearent/nexus                                                                               21                                      
sonatype/nexus-iq-server                     Sonatype Nexus IQ Server                        12                                      
bradbeck/nexus-https                         Dockerized version of Nexus Repo Manager 3 w…   8                                       [OK]
baselibrary/nexus                            ThoughtWorks Docker Image: nexus                7                                       [OK]
accenture/adop-nexus                         ADOP Nexus                                      5                                       [OK]
shifudao/nexus3                              clone from nexus3 image but based from openj…   4                                       [OK]
cavemandaveman/nexus                         Sonatype Nexus container                        4                                       [OK]
frekele/nexus                                docker run --rm --name nexus -p 8081:8081 fr…   4                                       [OK]
fabric8/nexus                                                                                3                                       [OK]
madmuffin/nexus3                             Sonatype Nexus3 Milestone7 docker image         2                                       [OK]
nexusstats/nexus-stats                                                                       1                                       
openshiftdemos/nexus                         Sonatype Nexus with JBoss Enterprise reposit…   1                                       
mcreations/jenkins-with-nexus-support        Jenkins image with correct SSL config for in…   1                                       [OK]
ocadotechnology/nexus-configurator           see: https://github.com/ocadotechnology/nexu…   0                                       
fjudith/nexus                                Dockerized Nexus Repository Manager based on…   0                                       [OK]
netspeedy/nexus                                                                              0                                       
jenkinsxio/nexus                                                                             0                                       
zbkio/nexus-noroot                           Nexus for Openshift                             0                                       
trialgrid/nexus-docker                       Nexus docker image                              0                                       
ocadotechnology/nexus-data-pipeline-backup   Backup Nexus3 with AWS Data Pipeline and EFS…   0                                       [OK]
ccdevopsford/nexus-resource                                                                  0                                       
stangenberg/nexus                            Docker container featuring Sonatype's Nexus …   0                                       [OK]

查询要安装的nexus2版本,docker search nexus2

[root@docker136 ~]# docker search nexus2
NAME                                 DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
alvarolinarescabre/nexus2-exporter   Prometehus Export for Nexus 2                   1                                       
bmr403/nexus2.11.1                   Nexus Professional 2.11.1-01 in CentOS using…   1                                       
smithpqs/nexus2                                                                      0                                       
aibar/nexus2                         Nexus 2 Docker Image                            0                                       [OK]
walkingdevs/nexus2                   Nexus 2                                         0                                       [OK]
nexus2099/tiny_flow                                                                  0                                       
nexus2099/tiny_flow_dev_golang                                                       0                                       
verilumaci/nexus2                    Nexus 2.13 with p2 plugins installed            0                                       [OK]
nordstromsets/nexus2artifactory                                                      0                                       
aftdevops/nexus2                                                                     0                                       
asinton/nexus2                                                                       0                                       
xingjiudong/nexus-openjdk            nexus2 change to openjdk                        0                                       [OK]
zjtzhzq/nexus                        nexus2  project for docker                      0                                       
nexus2099/tiny_form                                                                  0                                       
nexus2116/test  

安装镜像

推荐第一种
$ mkdir /some/dir/nexus-data && chown -R 200 /some/dir/nexus-data
$ docker run -d -p 8081:8081 --name nexus -v /some/dir/nexus-data:/nexus-data bmr403/nexus2.11.1或者
$ mkdir /some/dir/nexus-data && chown -R 200 /some/dir/nexus-data
$ docker run -d  -p 8081:8081  --rm --name nexus -v /some/dir/nexus-data:/nexus-data bmr403/nexus2.11.1

–rm Automatically remove the container when it exits。docker部署时如果容器已经存在则自动删除

需要开机自动启动docker 运行命令时的增加–restart

--restart string                 Restart policy to apply when a container exits (default "no")

三、导入jar包

手动将文件上传到nexus的存储库下

windows下路径E:\apps\sonatype-work\nexus\storage,无论windows还是linux都根据实际的存储目录找到指定存储库,上传jar即可
在这里插入图片描述

删除多余的文件

删除nexus下自己上传文件多余的库文件

find /home/nexus/storage/central/ -name "*-lastUpdated.properties" -exec rm -f {} \;  -name "*\.lastUpdated" -exec rm -f {} \; -or -name "_remote.repositories" -exec rm -f {} \;

引用私服

引用私服的时候只要使用公共库就可以了,公共库包含了所有本地库(hosted)和中心库(代理库proxy)
在这里插入图片描述


http://www.ppmy.cn/news/771258.html

相关文章

【NOIP2013模拟】Freda的传呼机 题解+代码

这题又有点像码农题!! Description 为了 随时 与 rainbow快速交流, Freda制造了 两部传呼机 。Freda和 rainbow所在的地方有N座房屋、M条双向 光缆 。每条光缆连接两座房屋, 传呼机发出的信号只能沿着光缆传递,并且 …

Numpy专栏目录(长期更新)

文章目录 数组基础文件与字符串多项式分布 Numpy绝对可以说是支撑Python地位的最重要的包了,几乎所有能叫出名的Python计算库,都不可避免地调用了Numpy,Numpy官网也列出了一些,大致如下图这样,堪称科学计算领域的瑞士军…

NES资料

NES资料 [3] NES 系统概述(NES Technical Overview) NES 是日本任天堂(Nintendo)公司于上个世纪 80 年代开发的 一款游戏主机,它同时也是此后 10 年里最受欢迎的游戏主机。 NES 在日本/亚洲的名称叫做 FC(…

剑指offer-刷题笔记-简单题-JZ25 合并两个排序的链表

剑指offer-刷题笔记-简单题-JZ25 合并两个排序的链表 思想是先对比,把两个链表合并到一起,注意最后可能会出现一个链表刚好结束,另一个链表还有剩余节点,因为链表是递增的,把,另一个链表的剩余值都链接到末…

Kinect v2 简介

kinect for windows v2 外观: kinect v1 与 kinect v2比较: Kinect v1 Kinect v2预览版 颜色(Color) 分辨率(Resolution) 640480 19201080 fps 30fps 30fps 深度(Depth)…

NOJ-算法设计实验-test3

原网站&#xff1a;http://phoenix-zh.cn/2020/10/23/NOJ-test3/ 先占个坑,等什么时候有空了,再补题解,先贴上代码. 代码都不长,就是简单bfs.vis标记注意状态.除了特殊的二阶魔方是真的恶心! A.加1乘2平方 #include<cstdio> #include<cstring> #include<ios…

利用celebA数据集训练MTCNN网络

利用celebA数据集训练MTCNN网络 celebA数据集简介训练数据的处理网络和训练侦测部分结果展示 有问题可以联系我的邮箱&#xff1a;2487429219qq.com 关于MTCNN网络可以看我上一篇博客&#xff1a;链接: 人脸检测算法&#xff1a;mtcnn简介 celebA数据集简介 CelebA数据集包含…

单片机实例3——多路开关状态指示(硬件电路图+汇编程序+C语言程序)

3&#xff0e; 多路开关状态指示 1&#xff0e; 实验任务 如图4.3.1所示&#xff0c;AT89S51单片机的P1.0&#xff0d;P1.3接四个发光二极管L1&#xff0d;L4&#xff0c;P1.4&#xff0d;P1.7接了四个开关K1&#xff0d;K4&#xff0c;编程将开关的状态反映到发光二极管上。&…