로컬 Maven웨어 하우스의 jar 패키지를 Nexus 개인 서버에 일괄 업로드

단계는 다음과 같습니다.
1. 먼저 로컬 maven / localrepository웨어 하우스의 전체 zip 패키지를 입력 합니다. 2. 다음과
같은 Linux 디렉토리에 업로드합니다. / opt
3. localrepository.zip 압축을 풉니 다
. 4. / opt / localrepository 디렉토리를 입력합니다.
5.1-4 단계, FTP / SFTP 도구를 통해 로컬 로컬 저장소를 / opt / localrepository에 직접 업로드 할 수 있습니다
여기에 사진 설명 삽입
. 6. touch 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}/{} ;

7. 실행 가능한 인증을 위해 chmod a + x mavenimport.sh를 입력
합니다. 8. import 명령을 실행합니다 (참고 : 주소를 자신의 개인 서버 주소로 변경).

./mavenimport.sh -u admin -p admin123 -r http://192.168.92.11:9999/nexus/content/repositories/thirdparty/

9. 모든 가져 오기가 완료되면 Nexus에서 새로 고침하여 가져온 jar를 확인합니다.
여기에 사진 설명 삽입

추천

출처blog.csdn.net/G_whang/article/details/111713272