• 私仓库Nexus


    私仓库Nexus搭建

    没有命令提示符tab键无效

    #安装Linux命令补全工具
    yum -y install bash-completion
    #执行bash或者reboot重启系统
    bash
    
    #如果上述的命令执行了有问题可以执行功能下面的命令
    yum install epel-release -y
    yum install bash-completion bash-completion-extras -y 
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8

    安装Linux命令补全工具

    命令执行过程
    [root@ebs-139265 ~]# yum -y install bash-completion
    Loaded plugins: fastestmirror
    Determining fastest mirrors
    epel/x86_64/metalink                                                                                                                                                                                       | 6.8 kB  00:00:00     
     * base: mirrors.ustc.edu.cn
     * epel: mirror.nyist.edu.cn
     * extras: mirrors.aliyun.com
     * updates: mirrors.aliyun.com
    base                                                                                                                                                                                                       | 3.6 kB  00:00:00     
    epel                                                                                                                                                                                                       | 4.7 kB  00:00:00     
    extras                                                                                                                                                                                                     | 2.9 kB  00:00:00     
    updates                                                                                                                                                                                                    | 2.9 kB  00:00:00     
    (1/5): extras/7/x86_64/primary_db                                                                                                                                                                          | 250 kB  00:00:00     
    epel/x86_64/primary_db         FAILED                                          
    https://mirror.01link.hk/epel/7/x86_64/repodata/6e8389beb8414d34d10dfe9ff045c741679ce310facb8c8e7fae7481bb1e527d-primary.sqlite.bz2: [Errno 14] curl#60 - "Peer's Certificate has expired."     ]  0.0 B/s |    0 B  --:--:-- ETA 
    Trying other mirror.
    It was impossible to connect to the CentOS servers.
    This could mean a connectivity issue in your environment, such as the requirement to configure a proxy,
    or a transparent proxy that tampers with TLS security, or an incorrect system clock.
    You can try to solve this issue by using the instructions on https://wiki.centos.org/yum-errors
    If above article doesn't help to resolve this issue please use https://bugs.centos.org/.
    
    (2/5): epel/x86_64/updateinfo                                                                                                                                                                              | 1.0 MB  00:00:00     
    (3/5): epel/x86_64/group_gz                                                                                                                                                                                |  99 kB  00:00:00     
    (4/5): epel/x86_64/primary_db                                                                                                                                                                              | 7.0 MB  00:00:02     
    (5/5): updates/7/x86_64/primary_db                                                                                                                                                                         |  23 MB  00:00:05     
    Resolving Dependencies
    --> Running transaction check
    ---> Package bash-completion.noarch 1:2.1-8.el7 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ==================================================================================================================================================================================================================================
     Package                                                     Arch                                               Version                                                    Repository                                        Size
    ==================================================================================================================================================================================================================================
    Installing:
     bash-completion                                             noarch                                             1:2.1-8.el7                                                base                                              87 k
    
    Transaction Summary
    ==================================================================================================================================================================================================================================
    Install  1 Package
    
    Total download size: 87 k
    Installed size: 263 k
    Downloading packages:
    bash-completion-2.1-8.el7.noarch.rpm                                                                                                                                                                       |  87 kB  00:00:00     
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : 1:bash-completion-2.1-8.el7.noarch                                                                                                                                                                             1/1 
      Verifying  : 1:bash-completion-2.1-8.el7.noarch                                                                                                                                                                             1/1 
    
    Installed:
      bash-completion.noarch 1:2.1-8.el7                                                                                                                                                                                              
    
    Complete!
    [root@ebs-139265 ~]# bash ##配置生效
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    验证

    输入命令 systemctl status ip 再按Tab键进行测试 如果出现提示 则代表正常

    关闭防火墙

    [root@ebs-139265 ~]# systemctl status iptables.service 
    Display all 271 possibilities? (y or n)
    [root@ebs-139265 ~]# systemctl status iptables.service  ## 查看防火墙状态
    ● iptables.service - IPv4 firewall with iptables
       Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled; vendor preset: disabled)
       Active: active (exited) since Sun 2023-10-15 10:42:05 CST; 32min ago
      Process: 517 ExecStart=/usr/libexec/iptables/iptables.init start (code=exited, status=0/SUCCESS)
     Main PID: 517 (code=exited, status=0/SUCCESS)
       CGroup: /system.slice/iptables.service
    
    Oct 15 10:42:05 ebs-139265 systemd[1]: Starting IPv4 firewall with iptables...
    Oct 15 10:42:05 ebs-139265 iptables.init[517]: iptables: Applying firewall rules: [  OK  ]
    Oct 15 10:42:05 ebs-139265 systemd[1]: Started IPv4 firewall with iptables.
    [root@ebs-139265 ~]# systemctl stop iptables.service   ## 关闭防火墙
    [root@ebs-139265 ~]# 
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16

    安装JDK

    [root@ebs-139265 opt]# tar -zxvf jdk-8u202-linux-x64.tar.gz  ##解压文件
    
    • 1
    配置环境
    [root@ebs-139265 opt]# vim /etc/profile
    
    • 1
    增加以下配置
    export JAVA_HOME=/opt/jdk1.8.0_202
    export JRE_HOME=${JAVA_HOME}/jre
    export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
    export PATH=${JAVA_HOME}/bin:$PATH
    
    • 1
    • 2
    • 3
    • 4
    生效配置
    [root@ebs-139265 opt]# source /etc/profile
    [root@ebs-139265 opt]# java -version
    java version "1.8.0_202"
    Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
    Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
    [root@ebs-139265 opt]# 
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    下载地址

    历史版本下载地址
    https://help.sonatype.com/repomanager3/product-information/download/download-archives---repository-manager-3
    
    • 1
    Unix archive	https://download.sonatype.com/nexus/3/nexus-3.60.0-02-unix.tar.gz 
    Windows archive	https://download.sonatype.com/nexus/3/nexus-3.60.0-02-win64.zip
    Mac OS archive	https://download.sonatype.com/nexus/3/nexus-3.60.0-02-mac.tgz 
    
    • 1
    • 2
    • 3
    官方安装文档地址
    https://help.sonatype.com/repomanager3/installation-and-upgrades/installation-methods
    
    • 1

    安装

    [root@ebs-139265 opt]# ls
    jdk1.8.0_202  jdk-8u202-linux-x64.tar.gz  nexus-3.55.0-01-unix.tar.gz
    [root@ebs-139265 opt]# mkdir nexus
    [root@ebs-139265 opt]# cd nexus/
    [root@ebs-139265 nexus]# cp ./../nexus-3.55.0-01-unix.tar.gz ./
    [root@ebs-139265 nexus]# ls
    nexus-3.55.0-01-unix.tar.gz
    [root@ebs-139265 nexus]# 
    [root@ebs-139265 nexus]# tar -zxvf nexus-3.55.0-01-unix.tar.gz  ## 解压文件
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    服务对应目录
    [root@ebs-139265 nexus]# ls
    nexus-3.55.0-01  nexus-3.55.0-01-unix.tar.gz  sonatype-work
    [root@ebs-139265 nexus]# cd nexus-3.55.0-01/
    [root@ebs-139265 nexus-3.55.0-01]# ls
    bin  deploy  etc  lib  NOTICE.txt  OSS-LICENSE.txt  PRO-LICENSE.txt  public  replicator  system
    [root@ebs-139265 nexus-3.55.0-01]# cd bin/
    [root@ebs-139265 bin]# ls
    contrib  nexus  nexus.rc  nexus.vmoptions
    [root@ebs-139265 bin]# pwd
    /opt/nexus/nexus-3.55.0-01/bin
    [root@ebs-139265 bin]# 
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    启动命令
    ## start, stop, restart, force-reload ,status
    [root@ebs-139265 bin]# ./nexus start
    WARNING: ************************************************************
    WARNING: Detected execution as "root" user.  This is NOT recommended!
    WARNING: ************************************************************
    Starting nexus
    [root@ebs-139265 bin]# 
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    日志目录
    [root@ebs-139265 log]# pwd
    /opt/nexus/sonatype-work/nexus3/log
    [root@ebs-139265 log]# tail -f nexus.log
    
    • 1
    • 2
    • 3
    账户信息

    默认密码为服务启动后生成的 admin.password 登录后修改密码

    [root@ebs-139265 nexus3]# ls
    admin.password  blobs  cache  db  elasticsearch  etc  generated-bundles  instances  karaf.pid  keystores  lock  log  orient  port  restore-from-backup  tmp
    [root@ebs-139265 nexus3]# pwd
    /opt/nexus/sonatype-work/nexus3
    [root@ebs-139265 nexus3]# 
    [root@ebs-139265 nexus3]# cat admin.password 
    3d68bd6a-8725-4749-96c2-119dd3a2ce86
    [root@ebs-139265 nexus3]# 
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    访问地址
    http://192.168.10.111:8081  ## 自己服务器的地址
    
    • 1

    在这里插入图片描述

    此处演示 修改账户与密码相同 为 admin

    配置

    自定义文件上传仓库

    登录上去后 点击菜单 upload 找到 maven-releases

    在这里插入图片描述

    此处以上传自定义 json 为例

    在这里插入图片描述

    点击 browse 选择本地包

    在这里插入图片描述

    完成后点击 browse菜单 就可以看到对应的 jar

    在这里插入图片描述

    配置第三方依赖下载地址

    此处以配置aliyun下载地址为例子

    在这里插入图片描述

    点击create repository

    在这里插入图片描述

    在这里插入图片描述

    完了之后保存

    在自定义仓库配置下载源 完成后保存

    在这里插入图片描述

  • 相关阅读:
    docker部署Vaultwarden密码共享管理系统
    JavaScript实现在HTML中的粒子文字特效
    OK6410A 开发板 (八) 126 linux-5.11 OK6410A GPIO驱动的应用
    Vue —— vue相关面试题分享
    Spring篇---第三篇
    基于Echarts实现可视化数据大屏车联网平台数据可视化
    Elasticsearch8 常用查询
    Nature Microbiology|溃疡性结肠炎的罪魁祸首:普通拟杆菌的蛋白酶
    https相关内容
    【nodejs】express-generator项目--创建接口及数据库连接
  • 原文地址:https://blog.csdn.net/u010416069/article/details/133841627