Skip to content

Instantly share code, notes, and snippets.

@fatmind
Last active December 20, 2015 08:58
Show Gist options
  • Save fatmind/6103867 to your computer and use it in GitHub Desktop.
Save fatmind/6103867 to your computer and use it in GitHub Desktop.
mvn并启动tomcat
:: Windows + tomcat 方便部署
set project_home=D:\workspace\lego\nut_bohan.sj_20130724
set app_name=nut-1.0.0-SNAPSHOT
set tomcat_home=D:\dev\tomcat-6.0.20
REM 0.编译. 待修复:不显示后续rem提示
@CD "%project_home%"
@CALL mvn clean install -DskipTests >nul 2>&1
REM 1.删除老目录
@CD "%tomcat_home%"
@rd /s /q "%tomcat_home%/webapps/%app_name%" >nul 2>nul
:: explain ref 'http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/rmdir.mspx?mfr=true'
REM 2.拷贝
@xcopy /e /i /h "%project_home%/nut-webapp/target/%app_name%" "%tomcat_home%/webapps/%app_name%" >nul 2>nul
:: explain ref 'http://www.edugeek.net/forums/scripts/5946-code-cmd-file-copy-folder-contents-other-drive.html#post60609'
REM 3.启动tomcat
@CD "%tomcat_home%/bin/"
@CALL ./startup.bat >nul 2>nul
::PAUSE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment