nexus私服创建仓库并且上传文件

1.添加私服仓库

1.png

2.jpg.png

33.jpg.png

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

  
# 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 . -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}/{};

5555555.jpg.png

666666.jpg.png

你可能感兴趣的:(maven,nexus,linux)