批量上传jar包倒Nexus

@echo off 
SET LOGFILE=MyLogFile.txt
set work_path= D:\software\apache-maven-3.8.5\repository
C: 
cd %work_path%
 
for /R %%s in (*.pom) do (
 
	cd %%~dps
 
	if exist %%~dpns.jar (
		curl -v -u 用户名:密码 -X POST http://10.32.2.130:8081/service/rest/v1/components?repository=xxx-central -F maven2.asset1=@%%~ns.jar -F maven2.asset1.extension=jar -F maven2.asset2=@%%~ns.pom -F maven2.asset2.extension=pom
	) else (
		curl -v -u 用户名:密码 -X POST http://10.32.2.130:8081/service/rest/v1/components?repository=xxx-central -F maven2.asset2=@%%~ns.pom -F maven2.asset2.extension=pom
	)
) 
 
pause
for /R "%1" %%i in (*.jar) do ( 
  echo  %%~di%%~pi%%~ni.jar
  echo  %%~di%%~pi%%~ni.pom
mvn -X deploy:deploy-file -Dpackaging=jar -Durl=http://10.32.2.130:8081/repository/xxx-central/ -DrepositoryId=xxx-central -Dfile=%%~di%%~pi%%~ni.jar -DpomFile=%%~di%%~pi%%~ni.pom
)

你可能感兴趣的:(jar,java,maven)