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

相关推荐
自强的小白4 分钟前
Spring事务失效的场景
java·spring
路溪非溪4 分钟前
Linux下Shell脚本基础知识(二)
linux·运维·服务器
小蒜学长11 分钟前
基于SpringBoot+Vue的小学数学智能出题系统(代码+数据库+LW)
java·数据库·spring boot·后端·智能出题系统
不灭的黄金瞳12316 分钟前
Java继承与多态
java·intellij-idea
企业数字化笔记31 分钟前
视频字幕如何烧录到成片?硬字幕、软字幕、样式控制与播放验收
java·ffmpeg
小朱爱编程12344 分钟前
我用 Jev 做了三个实用工具:整理标签页、分诊飞书反馈、找回 GitHub 收藏
java·开发语言·人工智能·后端·python·架构·ai编程
guo_wen_qiang1 小时前
云服务器kibana环境搭建
linux·运维·服务器
酷虎软件1 小时前
视频加标题字幕 API 接口文档
java·数据库·mysql
谢亮_vipxieliang1 小时前
Java 8/11/17/21/25 怎么选?一篇讲清 LTS 升级路线
java·开发语言
Cindy_cd1 小时前
IDEA2021 配置 JDK+Maven
java·开发语言·maven