Linux CentOS基于Dcoker安装Nexus3(Maven私服)

Linux CentOS基于Dcoker安装Nexus3(Maven私服),第1张

Linux CentOS基于Dcoker安装Nexus3(Maven私服)
  • 搜索镜像
docker search nexus

  • 拉取镜像
docker pull sonatype/nexus3

#将容器内部/var/nexus-data挂载到主机/root/nexus-data目录。
docker run -d -p 8081:8081 --name nexus -v /root/nexus-data:/var/nexus-data --restart=always sonatype/nexus3
  • 关闭防火墙
    • 阿里云默认是关闭的,查看防火墙状态
firewall-cmd --state
#停止防火墙
systemctl stop firewalld.service
#禁止开机启动防火墙
systemctl disable firewalld.service
  • 访问ip, http://ip:8081

  • 进入docker容器,查看密码
 docker exec -it 6b20b8a9c84b /bin/bash
 # 查看密码
 cat /nexus-data/admin.password
  • 登陆之后,会让你进行修改密码,等一系列 *** 作

  • 创建仓库,选择Maven2(host),填写完,点击create-resp

Release版本不允许 mvn deploy

  • 将刚刚创建好的仓库添加到mavne-public组中,然后点击save
  • 资源的上传
    • 配置Maven的setting文件
  
      
        test-release
        admin
        admin
      
  

	 
        nexus-test
        *
        http://ip:8081/repository/test-release/
    


    
        test-release
        http://ip:8081/repository/test-release/
    


这样maven的私服就创建好了

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/4663071.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-06
下一篇2022-11-06

发表评论

登录后才能评论

评论列表(0条)

    保存