whilegetopts":r:u:p:" opt;docase$optin
r)REPO_URL="$OPTARG";;
u)USERNAME="$OPTARG";;
p)PASSWORD="$OPTARG";;esacdonefind ./ type f -not-path'*/*.sh'-not-path'*/*.lastUpdated'-not-path'*/*.sha1'-not-path'*/*.md5'-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仓库根目录下;执行下面命令
sh push_nexus.sh -u USERNAME -p PASSWORD -r http://127.0.0.1:9998/repository/public