【环境搭建】linux docker安装nexus3

news/2025/2/12 15:21:30/

1、shell输入

docker run -dti \--net=host \--name=nexus3 \--privileged=true \--restart=always \--ulimit nofile=655350 \--ulimit memlock=-1 \--memory=1G \--memory-swap=-1 \-e INSTALL4J_ADD_VM_PARAMS="-Xms512m -Xmx512m -XX:MaxDirectMemorySize=1g" \-v /etc/localtime:/etc/localtime \-v /data/nexus3:/nexus-data \-p 8081:8081 --privileged=true \sonatype/nexus3

2、查看nexus日志,看到Started Sonatype Nexus OSS 表示启动好了

docker logs -f nexus3

3、查看密码

 cat /data/nexus3/admin.password 

登录 http://ip:8081 账号:admin 密码就是刚才看到的。

4、登录后的配置看这里

Docker 安装 nexus_银狐的技术博客_51CTO博客​​​​​​ 
 

5、java maven项目pom.xml配置

在pom.xml文件中配置 distributionManagement 节点如下,在项目中执行deploy命令后,jar包将会被上传到nexus中,<distributionManagement>部分。

默认地,maven编译打包不会下载SNAPSHOT版本的jar包,所以还需要在pom.xml文件中配置支持下载snapshot版本jar包,<repositories>部分。

<distributionManagement><repository><id>liledapu_hosted</id><!--release版本仓库--><name>Nexus Release Repository</name><!--hosted地址址--><url>http://xx:8081/repository/liledapu_hosted/</url></repository><snapshotRepository><id>liledapu_snapshots</id><!--snapshot版本仓库--><name>Nexus Snapshot Repository</name><url>http://xx:8081/repository/liledapu_snapshots/</url></snapshotRepository></distributionManagement><repositories><repository><id>liledapu_group</id><url>http://xx:8081/repository/liledapu_group/</url><snapshots><enabled>true</enabled></snapshots></repository></repositories>

6、maven 的setting.xml(apache-maven-3.9.0\conf目录下)添加配置,liledapu为配置的组名

<servers><server><id>liledapu_group</id><username>name</username><password>password</password></server><server><id>liledapu_hosted</id><username>name</username><password>password</password></server><server><id>liledapu_snapshots</id><username>name</username><password>password</password></server></servers><mirrors><mirror><id>liledapu_group</id><mirrorOf>central</mirrorOf><name>liledapu_group 私域</name><url>http://xxxxx:8081/repository/liledapu_group/</url></mirror><mirror><id>aliyunmaven</id><mirrorOf>*</mirrorOf><name>阿里云公共仓库</name><url>https://maven.aliyun.com/repository/public</url></mirror></mirrors>

到此就可以了


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

相关文章

MyBatisPlus(十九)自动填充

说明 自动填充指的是&#xff0c;当数据被 插入 或者 更新 的时候&#xff0c;会为指定字段进行一些默认的数据填充。 比如&#xff0c;插入时&#xff0c;会自动填充数据的创建时间和更新时间&#xff1b;更新时&#xff0c;会自动填充数据的更新时间。 实现方式 配置处理器…

design compiler之设计环境

design compiler之设计环境 设计环境是什么&#xff1f;设计环境的具体形式操作条件在深亚微米工艺下的一些特殊情况系统接口特性写在最后 设计环境是什么&#xff1f; 在综合之前我们需要定义实际设计所处的环境&#xff0c;从结果导向的角度来讲&#xff0c;设计环境定义的越…

Bugku sql注入 基于布尔的SQL盲注 经典题where information过滤

目录 绕过空格 /**/绕过 ()绕过 回车绕过 &#xff08;键按钮&#xff09;绕过 等号绕过 绕过&#xff0c;&#xff08;逗号&#xff09;使用substr 下面存在基本绕过方式 注释符绕过 /**/绕过 #绕过 /*注释内容*/绕过 //注释绕过 大小写绕过 绕过information过…

第六章 应用层 | 计算机网络(谢希仁 第八版)

文章目录 第六章 应用层6.1 域名系统DNS6.1.1 域名系统概述6.1.2 互联网的域名结构6.1.3 域名服务器 6.2 文件传送协议6.2.1 FTP概述6.2.2 FTP的基本工作原理6.2.3 简单文件传送协议TFTP 6.3 远程终端协议TELNET6.4 万维网www6.4.1 万维网概述6.4.2 统一资源定位符URL6.4.3 超文…

UE5蓝图-事件、函数、事件分发器

UE5蓝图中的事件、函数、事件分发器理解及学习 1 事件 蓝图的事件在事件图表中。 事件可以进行自定义。 1.1 首先自定义一个事件HelloUE 1.2 为事件指定具体的执行体 1.3 运行事件 1.4 绑定事件到 Actor被点击 先进行事件绑定&#xff0c;绑定完成后&#xff0c;BBBB被点击…

ESP32-IPS彩屏ST7789-Arduino-简单驱动

目的&#xff1a; 使ESP32能够驱动点亮ST7789显示屏 前提条件&#xff1a; ESP32 ST7789 &#xff08;240 x240&#xff0c;IPS&#xff09; 杜邦线 Arduino 过程&#xff1a; 0x00--接线 0x01--驱动&#xff1a; 彩屏驱动库 针对不同的彩屏驱动芯片&#xff0c;常用的 Arduino…

SpringBoot--手写组件动态更新@Value的值

原文网址&#xff1a;SpringBoot--手写组件动态更新Value的值_IT利刃出鞘的博客-CSDN博客 简介 本文手写组件&#xff0c;动态更新SpringBoot里Value的值&#xff08;无需重启服务&#xff09;。 不是可以用RefreshScope吗&#xff1f;为什么要手写组件&#xff1f; 动态更…

DataBinding使用报错

val dataBinding DataBindingUtil.setContentView<ActivityMainBinding>(this,R.layout.activity_main)报错一&#xff1a; Unresolved reference: ActivityMainBinding 首先你要知道一个概念&#xff0c;ActivityMainBinding是DataBinding中的一种视频绑定&#xff…