1.添加私服仓库
2.上传文件到nexus私服仓库
- nexus-upload.sh脚本如下
执行命令: sh +x nexus-upload.sh -u admin -p xxxx-0312 -r http://skf-nexus.xxxx.com/rep... // url 结尾 不要带 “/”
执行时需要把脚本放在你需要上传的目录中(最好不要更改脚本名称)
[root@xxxx-config-68l shell]# cat nexus-upload.sh
#!/bin/sh
if [ ! $# -eq 6 ];
then
echo " sh +x nexus-upload.sh -u user -p passwd -r url,实例:sh +x nexus-upload.sh -u admin -p xxxx-0312 -r http://skf-nexus.xxxx.com/repository/xxxx-release/"
exit
fi
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}/{};
find . -type f -not -path './nexus-upload\.sh*' -not -path '*\.sh' -not -path '*\.log' | sed "s|^\./||" | xargs -I '{}' curl -u "$USERNAME:$PASSWORD" -X PUT -v -T {} ${REPO_URL}/{};
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。