zoukankan      html  css  js  c++  java
  • CentOS 安装 nexus (maven 私服)

    原文:https://www.sunjianhua.cn/archives/centos-nexus.html

    1.下载

      wget http://download.sonatype.com/nexus/3/nexus-3.12.1-01-unix.tar.gz 
    

    2.安装

      tar -zxvf nexus-3.12.1-01-unix.tar.gz -C /usr/local/
    

    3.配置

      vi ~/.bashrc
      #加入下面一行:
      alias NEXUS_HOME="/usr/local/nexus-3.12.1-01/nexus-3.12.1-01"
    

    nexus-home.jpg

      
      #设置运行用户,此处博主设置为root
      vi /usr/local/nexus-3.12.1-01/nexus-3.12.1-01/bin/nexus.rc
      run_as_user="root"
      
      #配置jdk
      vi /usr/local/nexus-3.12.1-01/nexus-3.12.1-01/bin/nexus

    nexus-install-jdk.jpg

      
      #设置端口等
      vi /usr/local/nexus-3.12.1-01/sonatype-work/nexus3/etc/nexus.properties

    nexus-install-section.jpg

      
    
      #设置为服务
      cat <<EOF > /etc/systemd/system/nexus.service
      [Unit]
      Description=nexus service
      After=network.target      
      [Service]
      Type=forking
      LimitNOFILE=65536
      LimitNPROC=65535
      ExecStart=/usr/local/nexus-3.12.1-01/nexus-3.12.1-01/bin/nexus start
      ExecStop=/usr/local/nexus-3.12.1-01/nexus-3.12.1-01/bin/nexus stop
      User=root
      Restart=on-abort      
      [Install]
      WantedBy=multi-user.target      
      EOF
    
      #保存之后,授权
      chmod 745 /lib/systemd/system/nexus.service
    
      systemctl daemon-reload
      systemctl enable nexus.service
      #如果没有启动成功,查看日志
      tail -f /usr/local/nexus-3.12.1-01/sonatype-work/nexus3/log/nexus.log
    
      #其他命令
      systemctl  start|stop|run|run-redirect|status|restart|force-reload nexus
    

    4.其他安装方式:

       #docker 安装
       $ docker run -d -p 8081:8081 --name nexus sonatype/nexus3
    

    5.登录: http://ip:8081/

    默认账号密码:admin/admin123
    nexus-install-finish.jpg

    6.设置nexus

    a.配置代理仓库aliyun:
    nexus-setting-repo1.jpg
    nexus-setting-repo2.jpg

    b.配置私库third-party
    nexus-setting-repo3.jpg

    c.关联aliyun和third-party到maven-public中
    nexus-setting-repo-mix.jpg

    d.设置角色并授权用户且关闭匿名访问

    nexus-setting-role.jpg

    nexus-setting-user1.jpg

    nexus-setting-user2.jpg

    7.关联maven

    nexus-setting-maven1.jpg

    nexus-setting-maven2.jpg

    nexus-setting-maven3.jpg

    8.发布到私服测试

    nexus-deploy-a1.jpg

    nexus-deploy-a2.jpg

    nexus-deploy-a3.jpg

    nexus-deploy-a4.jpg

    nexus-deploy-a5.jpg

    nexus-deploy-a6.jpg

    9.相关文档

    https://help.sonatype.com/repomanager3

  • 相关阅读:
    [Js]面向对象基础
    [css]邮件的写法
    [Js]碰撞运动
    [Js]弹性运动
    [Js]布局转换
    [Js]高级运动
    [js]多个物体的运动
    [Js]缓冲运动
    外部 Storage Provider【转】
    hostPath Volume【转】
  • 原文地址:https://www.cnblogs.com/shihaiming/p/9990546.html
Copyright © 2011-2022 走看看