批量上传Nexus仓库脚本

push_nexus.sh
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 './push_nexus\.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}/{} ;
把push_nexus.sh放到本地mvn仓库根目录下;执行下面命令
USERNAME: nexus登陆账号 PASSWORD:nexus登陆密码
http://127.0.0.1:9998/repository/public: nexus服务地址/repository/仓库组
sh push_nexus.sh -u USERNAME -p PASSWORD -r http://127.0.0.1:9998/repository/public

你可能感兴趣的:(maven)