记快乐符号:
    利用 http 进行jar上传到nexus 批量批量~
    某天领导发一个压缩包给你;你解压一下 几十个jar包;领导说这个封装好的sdk包请将他上传到nexus 上面供大家使用!
    你看了看管理页面可以一个一个上传 你好像也开心不起来;所以加油
    ~
    保证对应group 一级进行命令执行
    如:

    1. <dependency>
    2. <groupId>com.squareup.okhttp3</groupId>
    3. <artifactId>okhttp</artifactId>
    4. <version>3.8.1</version>
    5. </dependency>

    groupId 以com开头我们就需要将我们的命令文件放在和com同级;依旧层级进行jar包的放置;可参考本地 maven 仓库里面的内容
    image.png
    sh文件内容 : 感谢广大网友的分享

    1. #!/bin/bash
    2. # copy and run this script to the root of the repository directory containing files
    3. # this script attempts to exclude uploading itself explicitly so the script name is important
    4. # Get command line params
    5. while getopts ":r:u:p:" opt; do
    6. case $opt in
    7. r) REPO_URL="$OPTARG"
    8. ;;
    9. u) USERNAME="$OPTARG"
    10. ;;
    11. p) PASSWORD="$OPTARG"
    12. ;;
    13. esac
    14. done
    15. 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}/{} ;

    执行命令 :
    ./mavenimport.sh -u 账号 -p 密码 -r 请求地址/repository/仓库名称