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

相关推荐
海阔天空任鸟飞~2 小时前
Linux 权限 777
linux·运维·服务器
Jelena157795857924 小时前
电商运营分析数据比价接口实战:多平台价格监控与智能决策系统
java·大数据·数据库
Kina_C5 小时前
Linux iptables 防火墙原理与实操——从四表五链到 NAT 配置
linux·运维·服务器·iptables
神明不懂浪漫5 小时前
【第五章】Java中的继承与多态
java·开发语言
AI多Agent协作实战派7 小时前
AI多Agent协作系统实战(十七):凌晨4点,我的AI系统在“假装工作“——3个bug同时爆炸的5小时
java·前端·bug
gaolei_eit7 小时前
Java+Ai+vue
java·spring·maven
qq_2518364577 小时前
基于java Web 动漫视频网站毕业论文
java·开发语言·前端
LayZhangStrive7 小时前
JUC相关的函数、注解、变量杂记
java·面试·多线程·juc
未秃头的程序猿8 小时前
给公司做了个AI客服Agent,用的Spring AI 1.0,3天上线领导拍板了
java·后端·ai编程
曹牧8 小时前
Eclipse 批量文本替换
java·ide·eclipse