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

相关推荐
前端工作日常16 分钟前
我学习到的Java类完整结构
java·后端
什巳29 分钟前
JAVA练习309- 二叉树的层序遍历
java·数据结构·算法·leetcode
宠友信息34 分钟前
消息序号如何保证即时通讯源码聊天记录稳定加载
java·spring boot·redis·python·mysql·uni-app
Spider Cat 蜘蛛猫43 分钟前
Anthropic的skill-creator使用分享
运维·服务器
圣光SG1 小时前
Java Web入门基础知识笔记
java·前端·笔记
liulilittle1 小时前
论分布式系统的半开闭问题
服务器·网络·分布式·系统架构·竞态
行思理2 小时前
微信支付“商家转账用户确认模式”,新手教程
java·开发语言·微信
cyforkk2 小时前
Vercel 绑定自定义域名极简配置指南
服务器·前端·网络
空中湖2 小时前
Spring AI RAG 完整实战:从零搭建企业知识库问答系统
java·人工智能·spring
Ai拆代码的曹操2 小时前
K8s Pod Pending 逐层排查:从 FailedScheduling 到 PVC StorageClass 不存在的实战记录
java·linux·kubernetes