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/
上一篇:c# – RestSharp – 如何影响JSON序列化(命名)?


下一篇:如何使用nexus3在无外网情况下(如云桌面)配置npm私库