#!/bin/bash
files="./files.out"
username="admin"
password="admin123"
nexusurl="http://{넥서스IP}:{넥서스Port}/repository/nexus/"
find . -name '*.*' -type f | cut -c 3- | grep "/" > $files
while read i; do
echo "upload $i to $nexusurl"
curl -v -u $username:$password --upload-file $i "$nexusurl$i"
done <$files
- Windows
- .m2/repository 에서 실행
@echo off
setlocal enabledelayedexpansion
set files=files.out
set username=admin
set password=admin123
set nexusurl=http://{넥서스IP}:{넥서스Port}/repository/nexus/
dir /b /s /a-d > %files%
for /f "usebackq tokens=*" %%i in (%files%) do (
set filepath=%%i
set filepath=!filepath:~2!
echo Uploading !filepath! to %nexusurl%
curl -v -u %username%:%password% --upload-file "!filepath!" "%nexusurl%!filepath!"
)
del %files%
endlocal