系统相关
首页 > 系统相关> > Nexus3.x批量导入本地库(Windows版)

Nexus3.x批量导入本地库(Windows版)

作者:互联网

“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}/{} ;

将脚本放到本地repository地址下
http://你的ip:你的端口/repository/my_repo/ 为你nexus中的hosted类型的maven2 地址

./mavenimport.sh -u admin -p admin123 -r http://你的ip:你的端口/repository/my_repo/

标签:xml,repository,script,Windows,mavenimport,Nexus3,导入,path,OPTARG
来源: https://www.cnblogs.com/fly-book/p/15141282.html