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

相关推荐
qqacj11 分钟前
Spring Security 官网文档学习
java·学习·spring
Rsun0455121 分钟前
10、Java 桥接模式从入门到实战
java·开发语言·桥接模式
金銀銅鐵23 分钟前
[Java] 从 class 文件看 cglib 对 MethodInterceptor 的处理 (下)
java·后端
lee_curry26 分钟前
Java中关于“锁”的那些事
java·线程·并发·juc
pearlthriving32 分钟前
c++当中的泛型思想以及c++11部分新特性
java·开发语言·c++
梦魇星虹1 小时前
idea Cannot find declaration to go to
java·ide·intellij-idea
小雅痞1 小时前
[Java][Leetcode hard] 42. 接雨水
java·开发语言·leetcode
xfcoding1 小时前
关于代码注释的思考
java
虹梦未来1 小时前
【开发心得】在SpringBoot体系中正确使用redisConfig
java·spring boot·spring
skiy1 小时前
Spring Framework 中文官方文档
java·后端·spring