赞
踩
1.先将本地repository仓库压缩成一个完整的zip压缩包
2.创建import.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 ./repository -type f -not -path './import\.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}/{} ;
3.将上述压缩包个脚本上传到linux目录,如:/home/maven
4.解压repository.zip,会在/home/maven路径下生成repository 文件夹
5.进入/home/maven目录
6.输入chmod a+x import.sh进行可执行授权
7.执行导入命令 (注意:将地址换成自己的私服地址)
./import.sh -u admin -p admin -r http://ip:8081/repository/maven-xxx/
8.等待全部导入完毕后,在Nexus上刷新即可看到已导入的jar包
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。