获取最新代码
svn update --username %SVN_USER% --password %SVN_PASSWORD% >> " ../%LOG_FILE% "
备份Tomcat 站点
md " %APP_ROOT%\backup\%MVN_PROFILE%-%CUR_DATE%-%myran% " >> " %LOG_FILE% " xcopy " %APP_ROOT%\%MVN_PROFILE% " " %APP_ROOT%\backup\%MVN_PROFILE%-%CUR_DATE%-%myran% " /s >> " %LOG_FILE% "
编译代码
必须要调用cmd 的cal命令l, 不然maven命令会直接退出整个bat, 这个问题调了我大半个晚上.
call mvn clean install -DskipTests -P %MVN_PROFILE% -f %MVN_POM% >> " %LOG_FILE% "
停掉tomcat服务
net stop Tomcat6 >> " %LOG_FILE% "
发布站点
rd /s/q " %APP_ROOT%\%MVN_PROFILE% " >> " %LOG_FILE% " md " %APP_ROOT%\%MVN_PROFILE% " >> " %LOG_FILE% " xcopy " %MVN_WEBAPP%\%MVN_PROFILE% " " %APP_ROOT%\%MVN_PROFILE% " /s >> " %LOG_FILE% " xcopy " %MVN_3RD_LIB% " " %APP_ROOT%\%MVN_PROFILE%\WEB-INF\lib " >> " %LOG_FILE% "
启动tomcat服务
net start Tomcat6 >> " %LOG_FILE% "
一个简单的dos脚本, svn 获取代码 - Tomcat 备份 - Maven 编译 - 停止/启动Tomcat - Tomcat站点 发布