maven私服上传jar包

将一下脚本保存在.bat文件执行,红色部分按实际状况修改:url

 

@echo offspa

set groupId=com.xxx
set artifactId=xxx
set version=0.0.1
set jarFilePath=D:/file/%artifactId%-%version%.jarblog

set nexusUrl=http://xxx.xxx.xxx.xxx:8081/nexus/content/repositories/snapshots
set repositoryId=snapshotsrem

echo groupId = %groupId%
echo artifactId = %artifactId%
echo version = %version%
echo jarFilePath = %jarFilePath%
echo nexusUrl = %nexusUrl%get

echo ===== mvn 命令开始发布 start =====
pauseit

rem 在BAT文件里面执行Maven的mvn命令后,mvn以后的命令不会被执行,
rem 这是因为mvn自己也是BAT文件,而且其结束时执行了exit命令
rem 要让mvn命令不使当前脚本自动退出,只须要在mvn以前加上call命令:io

call mvn deploy:deploy-file -DgroupId=%groupId% -DartifactId=%artifactId% -Dversion=%version% -Dpackaging=jar -Dfile=%jarFilePath% -Durl=%nexusUrl% -DrepositoryId=%repositoryId%file

echo ===== mvn 命令结束 end=====
pausecall

 

https://files.cnblogs.com/files/liujf-a-mad-man/mvn_deploy.rar脚本

相关文章
相关标签/搜索