本地打压缩包
把需要上传本地jar包打成压缩包文件
上传linux服务器
1、将打完后的压缩文件上传linux服务器
2、执行解压命令:unzip 压缩文件名称
新建脚本文件
执行新建脚本命令:vim mavenimport.sh
脚本文件内容:
#!/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}/{} ;
授予脚本文件权限
授予权限命令:chmod a+x mavenimport.sh
执行命令
执行命令:./mavenimport.sh -u 用户名 -p 密码 -r 地址