jar依赖批量上传Nexus服务器(二)

jar依赖批量上传Nexus服务器(二)

批量上传脚本

复制代码
#!/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
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 './mavenimport\.sh*' -not -path '*/\.*' -not -path '*/\^archetype\-catalog\.xml*' -not -path '*/\^maven\-metadata\-local*\.xml' -not -path '*/\^maven\-metadata\-deployment*\.xml' | sed "s|^\./||" | xargs -I '{}' curl -u "$USERNAME:$PASSWORD" -X PUT -v -T {} ${REPO_URL}/{} ;

制作脚本后放到仓库同级目录

执行脚本

脚本名称自定义,应和执行脚本时一致

复制代码
# 执行命令下面导入
#  ./import.sh -u 你的nexus用户名 -p 你的nexus密码 -r http://127.0.0.1:8081/repository/my_repo/
 

如果是在windows系统执行脚本可能回出现

可以在git bash 执行即可

相关推荐
zfj3211 分钟前
Linux内核和发行版的的区别、职责
linux·运维·服务器·内核·linux发行版
廋到被风吹走15 分钟前
【Spring】Spring Cache 深度解析
java·后端·spring
计算机毕设VX:Fegn089524 分钟前
计算机毕业设计|基于springboot + vue个人博客系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·后端·课程设计
2501_9466756434 分钟前
Flutter与OpenHarmony打卡轮播图组件
java·javascript·flutter
`林中水滴`37 分钟前
Linux Shell 命令:nohup、&、>、bg、fg、jobs 总结
linux·服务器·microsoft
appearappear39 分钟前
阿里云同区域不同账户下两个服务器打通内网
服务器·阿里云·云计算
helloworddm41 分钟前
防止应用多开-WPF
服务器·架构·c#
独自破碎E42 分钟前
Spring Boot 3.x和2.x版本相比有哪些区别与改进?
java·spring boot·后端
最后一个bug43 分钟前
当linux触发panic后进行自定义收尾回调处理
linux·服务器·系统架构·bug
坚持学习前端日记1 小时前
个人运营小网站的最佳策略
java·学习·程序人生·职场和发展·创业创新