Nexus3.25版本初始化maven仓库,远端仓库没有依赖,本地有Maven打包失败问题

本文介绍了如何在Linux服务器上使用sh脚本同步本地Maven仓库到Nexus 3.25版本,并处理远程仓库依赖冲突。重点讲述了遇到的依赖问题,即本地存在但远端未上传的依赖导致构建失败,以及解决方法——删除_local.repositories文件以避免远程下载。

1. nexus 3.25版本maven仓库,同步依赖

        上传本地依赖仓库压缩包至服务器,Linux 服务器新建sh脚本,内容填充以下内容,脚本位置在解压依赖的目录下,与各种依赖包同级。
        运行命令: ./nexusImport.sh -u admin -p admin123 -r http://xxxxx:8280/repository/self-repo/

```java
#!/bin/bash
# copy and run this script to the root of the repository directory containing files
# this script attempts to exclude uploading itself explicitly so the script name is important
# Get command line params
#运行指令 依赖同级文件夹下运行 ./nexusImport.sh  -u admin -p admin123 -r http://xxxxx:8280/repository/self-repo/ 


while getopts ":r:u:p:" opt; do
 case $opt in
     r) REPO_URL="$OPTARG"
     ;;
     u) USERNAME="$OPTARG"
     ;;
     p) PASSWORD="$OPTARG"
     ;;
 esac
done
 
find . -type f -not -path './mavenUpload\.sh*' -not -path '*/\.*' -not -path '*/\^archetype\-catalog\.xml*' -not -path '*/\^maven\-metadata\-local*\.xml' -not -path '*/\^
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值