准备shell脚本用来执行shell命令
a.sh
#!/bin/bash
#copy and run this script to the root of the repository directory containing files
while getopts ":r:u:p:" opt; do
case $opt in
r) REPO_URL="https://***" #目标仓库地址
;;
u) USERNAME="***" #具有读写仓库权限的账号
;;
p) PASSWORD="**" #密码
;;
esac
done
find . -type f -name *.jar -o -name *.pom | sed "s|^\./||" | xargs -I '{}' curl -u "$USERNAME:$PASSWORD" -X PUT -v -T {} ${REPO_URL}/{} ;
Window想执行shell脚本只需要一个git(需要配置好环境变量(系统变量))
打开git/bin/sh.exe
cd /d/...切到a.sh存放的目录下(a.sh要放在你自己的maven地址下面才能挪过去啊)
执行 ./a.sh -u ***(用户名) -p ***(密码)-r ***(url)