# 执行命令下面导入@b@# ./mavenimport.sh -u 你的nexus用户名 -p 你的nexus密码 -r http://127.0.0.1:8081/repository/my_repo/@b@@b@@b@#!/bin/bash@b@# copy and run this script to the root of the repository directory containing files@b@# this script attempts to exclude uploading itself explicitly so the script name is important@b@# Get command line params@b@while getopts ":r:u:p:" opt; do@b@ case $opt in@b@ r) REPO_URL="$OPTARG"@b@ ;;@b@ u) USERNAME="$OPTARG"@b@ ;;@b@ p) PASSWORD="$OPTARG"@b@ ;;@b@ esac@b@done@b@ @b@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}/{} ;