当前位置: 首页 > news >正文

windows安装Nexus3.6

windows安装Nexus3.6

  • 1、安装步骤
  • 2、禁用匿名登录
  • 3、Nexus仓库介绍和实际使用配置
    • 3.1、Nexus仓库介绍
    • 3.2、配置阿里云仓库地址
    • 3.3、配置maven访问Nexus私服
    • 3.4、配置访问Nexus的用户名密码
    • 3.5、将 jar 包部署到 Nexus
    • 3.6、下载别人deploy到Nexus 的 jar 包
    • 3.7、下载别人deploy到Nexus 的 jar 包失败
  • 4、安装遇到的报错信息
    • 4.1、报错一

1、安装步骤

1、解压安装包。
2、管理员打开cmd终端,进入bin目录下执行,大概两分钟,中间不要打断。

#启动Nexus
nexus.exe /run

3、安装成功。
在这里插入图片描述
4、访问 http://localhost:8081/
登录

点击右上角的 Sign in
默认登录账号:admin
密码:admin123

2、禁用匿名登录

如下图,去掉打勾就是禁用匿名登录,反正允许匿名登录。
在这里插入图片描述

3、Nexus仓库介绍和实际使用配置

3.1、Nexus仓库介绍

1、maven-central: maven中央库,默认从 https://repo1.maven.org/maven2/ 拉取jar
2、maven-releases: 私库发行版jar
3、maven-snapshots:私库快照(调试版本)jar
4、maven-public: 仓库分组,把上面三个仓库组合在一起对外提供服务,在本地maven基础配置settings.xml中使用。Nexus默认的仓库类型有以下四种:(上面的名字可以随便取,关键是它对应的是什么仓库类型)
1、group(仓库组类型):又叫组仓库,用于方便开发人员自己设定的仓库;
2、hosted(宿主类型):内部项目的发布仓库(内部开发人员,发布上去存放的仓库);
3、proxy(代理类型): 从远程中央仓库中寻找数据的仓库(可以点击对应的仓库的Configuration页签下Remote Storage Location属性的值即被代理的远程仓库的路径);
4、virtual(虚拟类型): 虚拟仓库(这个基本用不到,重点关注上面三个仓库的使用);
Policy(策略):表示该仓库为发布(Release)版本仓库还是快照(Snapshot)版本仓库;

如下图:
在这里插入图片描述

3.2、配置阿里云仓库地址

如下图,如果Nexus仓库里没,就会主动去阿里云仓库地址下载。

http://maven.aliyun.com/nexus/content/groups/public

在这里插入图片描述

3.3、配置maven访问Nexus私服

在setting.xml中配置。

<mirror><id>nexus-mine</id><mirrorOf>central</mirrorOf><name>Nexus mine</name><url>http://localhost:8081/repository/maven-public/</url>
</mirror>

3.4、配置访问Nexus的用户名密码

上面我们禁用了匿名登录,所以需要配置下访问的用户名密码。如果没禁用,则不用配置。
在setting.xml中配置。
这里需要格外注意:server 标签内的 id 标签值必须和 mirror 标签中的 id 值一样。

<server><id>nexus-mine</id><username>admin</username><password>admin123</password>
</server>

3.5、将 jar 包部署到 Nexus

在你的项目的pom.xml中配置。
配置setting.xml应该也可以,我这里是配置到pom.xml的。

<distributionManagement><snapshotRepository><id>nexus-mine</id><name>Nexus Snapshot</name><url>http://localhost:8081/repository/maven-snapshots/</url></snapshotRepository>
</distributionManagement>

3.6、下载别人deploy到Nexus 的 jar 包

在你的项目的pom.xml中配置。
配置setting.xml应该也可以,我这里是配置到pom.xml的。

<repositories><repository><id>nexus-mine</id><name>nexus-mine</name><url>http://localhost:8081/repository/maven-snapshots/</url><snapshots><enabled>true</enabled></snapshots><releases><enabled>true</enabled></releases></repository>
</repositories>

3.7、下载别人deploy到Nexus 的 jar 包失败


这里需要注意,我本地老是下载不了别人deploy到Nexus私服上的包,
刚开始我用的是maven3.6版本的不能下载,后来改成maven3.9.10版本就可以正常下载了。

如果还下载失败,在idea的maven, Runner里加,如下图:

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true

在这里插入图片描述

我本机用的是idea2025+maven3.9.10+Nexus3.6

4、安装遇到的报错信息

4.1、报错一

报错内容如下:

2025-06-07 00:24:00,529+0800 WARN  [qtp1638640525-56] admin com.sonatype.nexus.plugins.outreach.internal.outreach.SonatypeOutreach - Could not download page bundle
org.apache.http.conn.ConnectTimeoutException: Connect to sonatype-download.global.ssl.fastly.net:443 [sonatype-download.global.ssl.fastly.net/128.242.240.189] failed: connect timed outat org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:150)at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)at com.sonatype.nexus.plugins.outreach.internal.outreach.OutreachConnector.get(OutreachConnector.java:136)at com.sonatype.nexus.plugins.outreach.internal.outreach.SonatypeOutreach.remote(SonatypeOutreach.java:205)at com.sonatype.nexus.plugins.outreach.internal.outreach.SonatypeOutreach.getPageBundle(SonatypeOutreach.java:158)at com.sonatype.nexus.plugins.outreach.Outreach$getPageBundle.call(Unknown Source)at com.sonatype.nexus.plugins.outreach.internal.ui.OutreachComponent.readStatus(OutreachComponent.groovy:54)at com.sonatype.nexus.plugins.outreach.internal.ui.OutreachComponent$$EnhancerByGuice$$da361546.CGLIB$readStatus$7(<generated>)at com.sonatype.nexus.plugins.outreach.internal.ui.OutreachComponent$$EnhancerByGuice$$da361546$$FastClassByGuice$$3b23404d.invoke(<generated>)at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228)

解决方法
如下图,点设置图标-》Capabilities-》Outreach:Management-》点Disable
然后重启Nexus即可解决报错信息。
在这里插入图片描述

http://www.xdnf.cn/news/940861.html

相关文章:

  • Vue3 + TypeSrcipt 防抖、防止重复点击实例
  • ES8 向量功能窥探系列(二):向量数据的存储与优化
  • Redis 知识点一
  • c# 完成恩尼格玛加密扩展
  • Java线程工厂:定制线程的利器
  • Java线程同步技术深度解析与实践
  • 使用自定义模板的方式批量切割图片。
  • 227.2018年蓝桥杯国赛 - 交换次数(中等)- 贪心
  • 百度首页布局:固定右侧盒子不随界面缩小掉下去
  • 深入解析 Qwen3-Embedding 的模型融合技术:球面线性插值(Slerp)的应用
  • 结合三维基因建模与智能体技术打造工业软件无码平台
  • Python 接口:从协议到抽象基 类(Tombola子类的测试方法)
  • C++核心编程_继承同名静态成员处理方式
  • Java常见异常处理指南:IndexOutOfBoundsException与ClassCastException深度解析
  • C++_核心编程_继承中构造和析构顺序
  • LLMs 系列科普文(6)
  • 第二十七章 位置参数
  • 算数运算符
  • 【阿里巴巴 x 浙江大学】信息与交互设计 - 交互设计概述
  • HNSW - 分层可导航小世界
  • Secs/Gem第十二讲(基于secs4net项目的ChatGpt介绍)
  • ServerTrust 并非唯一
  • Linux操作系统Shell脚本企业级综合练习
  • 2.1.3_2 编码和调制(下)
  • 面壁智能推出 MiniCPM 4.0 端侧大模型,引领端侧智能新变革
  • Python Day45 学习(日志Day13-14复习)
  • JLINK脚本初始化外部SDRAM STM32H7
  • 基于51单片机的红外防盗及万年历仿真
  • 2025-04-23-基于上下位机结构的系统实例分析
  • 基于n8n指定网页自动抓取解析入库工作流实战