SCM (형상관리)/nexus
nexus에 jar 라이브러리 일괄 추가
뿌사리다
2022. 2. 18. 00:20
Nexus 서버에 jar 라이브러리를 한번에 올리는 방법
.m2/repository 디렉토리를 압축해서 리눅스 서버에 업로드한다.
mavenimport.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 . -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}/{} ; |
업로드 명령어
./mavenimport.sh -u ppusarida -p ppusarida123 -r http://ppusari.iptime.org:1234/nexus/content/repositories/releases/
728x90
반응형
LIST