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 执行即可

相关推荐
记得开心一点嘛几秒前
手搓Springboot
java·spring boot·spring
老华带你飞29 分钟前
租房平台|租房管理平台小程序系统|基于java的租房系统 设计与实现(源码+数据库+文档)
java·数据库·小程序·vue·论文·毕设·租房系统管理平台
独行soc29 分钟前
2025年渗透测试面试题总结-66(题目+回答)
java·网络·python·安全·web安全·adb·渗透测试
脑子慢且灵1 小时前
[JavaWeb]模拟一个简易的Tomcat服务(Servlet注解)
java·后端·servlet·tomcat·intellij-idea·web
Empty_7771 小时前
SELinux安全上下文
linux·服务器·安全
华仔啊2 小时前
SpringBoot 中 6 种数据脱敏方案,第 5 种太强了,支持深度递归!
java·后端
异常驯兽师3 小时前
Spring 中处理 HTTP 请求参数注解全解析
java·spring·http
连合机器人3 小时前
晨曦中的守望者:当科技为景区赋予温度
java·前端·科技
AD钙奶-lalala3 小时前
idea新建的项目new 没有java class选项
java·ide·intellij-idea