日常的工作中,需要协助开发人员上传一些jar包和pom.xml,需要批量导入jar包:

mavenimport.sh 脚本内容如下: #!/bin/bash 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 '/.' -not -path '/^archetype-catalog.xml' -not -path '/\maven-metadata-local**.xml' -not -path '/^maven-metadata-deployment*.xml' -exec curl -u $USERNAME:$PASSWORD -X PUT -v -T {} $REPO_URL{} ;

执行j脚本: sh mavenimport.sh -u admin -p 123456 -r http://10.0.0.100:30003/repository/maven-releases/

sh mavenimport.sh -u admin -p Daocloud@0501.com -r http://10.0.0.100:30003/repository/maven-snapshots/

登录nexus仓库查看