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

相关推荐
wuminyu3 分钟前
Linux内核线程调度与虚拟线程调度机制系统级深度剖析
java·linux·c语言·jvm·c++
诸葛李5 分钟前
linux 配置
linux·运维·服务器
TechWayfarer10 分钟前
做IP归属地查询时总是查不准?IP纯净度检测实战:从“查归属地“到识别“脏IP“的四个维度
服务器·网络·python·tcp/ip·安全·web安全
Aime_Perfect16 分钟前
sqlserver always on
服务器·数据库·sqlserver
小溪学编程26 分钟前
Java InputStream 详解:从基础到实战
java·python·php
血小板要健康27 分钟前
队列 + 宽搜(BFS):二叉树层序遍历 算法总结
java·数据结构·笔记·算法·leetcode·宽度优先
A黄俊辉A1 小时前
【无标题】
java
BestHeaker1 小时前
跨企业接口对接:IQDS / CPK 数据解析与协作避坑指南(五)
java·服务器·前端
其实防守也摸鱼1 小时前
OpenClaw 深度解析:从原理到实战的完整指南
运维·服务器·数据库·github·copilot
俊昭喜喜里1 小时前
C#中的func<>
java·前端·c#