windows搭建maven私服

本文详细介绍Nexus仓库管理系统的基本操作,包括下载、安装、配置及使用方法。涵盖服务启动、项目发布、配置Maven及访问私服等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

下载

Download Nexus Repository OSS | Sonatype

Nexus Repository Manager - Software Component Management | Sonatype

https://sonatype-download.global.ssl.fastly.net/repository/downloads-prod-group/3/nexus-3.75.1-01-win64.zip

通过百度网盘分享的文件:nexus-3.75.1-01-win64.zip
链接:https://pan.baidu.com/s/1PqvL7c5fWXHdnqTES0VHMg?pwd=1234 
提取码:1234

查询

nexus.exe --help

nexus.exe /install   安装服务,将程序安装到系统服务列表
nexus.exe /run       运行服务,将程序启动起来(前台线程启动,退出界面即退出程序)
nexus.exe /start     启动服务,将程序以服务的形式启动,将后台调用run进行启动,需等待部分时间完成启动
nexus.exe /stop      停止服务
nexus.exe /status    查看服务状态
nexus.exe /uninstall 卸载服务,在系统服务列表卸载当前服务后,可执行install重新安装

修改端口

etc\nexus-default.properties默认8081

启动

nexus.exe /run

访问http://localhost:9007/

登录

项目发布到私服

登录

修改maven安装目录下的/conf/settings.xml文件

    <mirror>		
	  <id>nexus-public</id>
	  <mirrorOf>*</mirrorOf>
	  <name>nexus public</name>
	  <url>http://ip:9007/repository/maven-public/</url>
	</mirror>

允许匿名访问不需要配置,ID保持一致

    <server>
      <id>nexus-public</id>
      <username>admin</username>
      <password>xxxx</password>
    </server>

项目配置

    <repositories>
        <repository>
            <id>nexus-public</id>
            <name>nexus public</name>
            <url>http://ip/repository/maven-public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>nexus-public</id>
            <name>nexus public</name>
            <url>http://ip/repository/maven-public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

打包发布

查看资源

上传资源

命令上传

mvn deploy:deploy-file -DgroupId=<group-id> \
  -DartifactId=<artifact-id> \
  -Dversion=<version> \
  -Dpackaging=<type-of-packaging> \
  -Dfile=<path-to-file> \
  -DrepositoryId=<id-to-map-on-server-section-of-settings.xml> \
  -Durl=<url-of-the-repository-to-deploy>

mvn deploy:deploy-file -DgroupId=commons-io \
  -DartifactId=commons-io \
  -Dversion=2.15.1 \
  -Dpackaging=jar \
  -Dfile=/Users/fanshaorong/Desktop/temp/repo/2.15.1/commons-io-2.15.1.jar \
  -DrepositoryId=nexus-public \
  -Durl=http://xx.xx.xx.xx/repository/maven-public/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值