用博客记录点滴……

nexus-2.14.2-01-bundle构建maven私服

一、下载nexus

地址:https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.14.2-01-bundle.zip

二、启动服务

解压nexus-2.14.2-01-bundle.zip

在bin/jsw下有不同的版本,这里我选择window 64位操作系统的版本。

console-nexus.bat  是以命令窗口的形式启动,关闭后服务停止

install-nexus.bat   是设置开机启动,在服务中可以看成到该服务为开机自动启动(推荐使用这种方式启动)

stop-nexus.bat      是停止服务

uninstall-nexus.bat  是卸载nexus

三、服务配置

启动后输入:http://localhost:8081/nexus  进入在右上角Login登录,初始用户名:admin 密码:admin123

1、修改登录密码

2、配置参数,将Download Remote Indexes 设置为true

3、添加第三方jar包

  3.1、选择和填写参数(groupId、artifactId、version)都要填写

  

 3.2、选择上传的jar包

三、项目调用方法

1、配置maven的settings.xml文件

  1.1、设置jar包保存的本地目录(我设置的是D盘)

 <localRepository>D:\MavenRepository\server_jar</localRepository>

 

 1.2、设置私服地址

<mirror>  
       <id>central</id>
       <mirrorOf>*</mirrorOf> <!-- * 表示让所有仓库使用该镜像--> 
       <name>central-mirror</name> 
       <url>http://192.168.1.253:8081/nexus/content/groups/public/</url>  
</mirror> 

 

 1.3在maven项目的POM.xml文件中增加配置

复制代码
<!--指定仓库 -->
    <repositories>
        <repository>
            <id>central</id>
            <url>http://192.168.1.253:8081/nexus/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <!--指定插件仓库 -->
    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <url>http://192.168.1.253:8081/nexus/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
复制代码

 

posted @   aegisada  阅读(6954)  评论(0编辑  收藏  举报
编辑推荐:
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 使用C#创建一个MCP客户端
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示