Java教程

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/
这篇关于Nexus3.x批量导入本地库(Windows版)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!