首页 > 学院 > 开发设计 > 正文

maven自动编译脚本

2019-11-06 06:05:54
字体:
来源:转载
供稿:网友
在maven工程根目录创建windows批处理脚本文件,例如tool.bat,内容如下
@echo off color 1f:menuecho -------------------------------------------------------echo +      1 - compile     2 - deploy      3 - version    +echo ------------------------------------------------------- :inputset /p input=please select: if "%input%"== "1" goto compileif "%input%"== "2" goto deployif "%input%"== "3" goto versiongoto refresh :compileecho starting clean target directory and compile PRoject...mvn clean package -Dmaven.test.skip=true &&pauseexit :versionecho this Operation will change the project version, including the version of all the module projectsset /p version=please input a new version:call mvn clean versions:set -DnewVersion=%version%del /s pom.xml.versionsBackupecho successfully changed project version, the new version is: %version%pauseexit :deployecho starting compile project and deploy jar file to maven repository...mvn deploy -Dmaven.test.skip=true &&pauseexit :refreshecho invalid input &&pause &&cls &&goto menu

功能介绍如下:

compile:编译deploy:发布到maven仓库versioin:修改工程及子工程版本号
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表