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

相关推荐
zwm_yy几秒前
服务器检查内存爆满
运维·服务器
摩尔元数3 分钟前
2025,服务器通信MES厂商谁主沉浮?
运维·服务器
last demo4 分钟前
nfs服务器
linux·运维·服务器·php
Charles_go9 分钟前
C#中级39、什么是依赖注入设计模式
java·设计模式·c#
ComplexPy12 分钟前
ZKMall-B2B2C Redission延时队列
java·redis
q***965812 分钟前
深入解析Spring Boot中的@ConfigurationProperties注解
java·spring boot·后端
java1234_小锋12 分钟前
讲讲Mybatis的一级、二级缓存?
java·开发语言·mybatis
e***877015 分钟前
记录 idea 启动 tomcat 控制台输出乱码问题解决
java·tomcat·intellij-idea
发现你走远了20 分钟前
2025 idea 指定配置环境运行springboot 设置active和env启动端口,多端口启动 (保姆级图文)
java·spring boot·intellij-idea
翼龙云_cloud22 分钟前
阿里云渠道商:自建或RDS怎么迁移到阿里云PolarDB?
运维·服务器·阿里云·云计算