@ECHO OFF
@REM 部署WEB系统到Tomcat
set date=%date:~0,10%
set time=%time:~0,8%
set currDate=%date% %time%
echo 开始运行将工作空间里面编译后的代码拷贝到Tomcat中...%currDate%
echo 设置参数
set WORK_SPACE=J:\飘\IT\workspace
set PRJ_NAME=MyStruts1Prj
set PRJ_WEB_ROOT=MyStruts1Prj\WebContent
set BIN=build
set CATALINA_HOME=J:\飘\IT\tools\tomcat6_0_3_5
set WEB_NAME=webapp
@REM 删除之前的
echo 删除之前存在的
cd %CATALINA_HOME%\webapps
if exist %WEB_NAME% rd /s /q %WEB_NAME%
@REM 新建
md %WEB_NAME%
@REM 拷贝工程中编译好的文件到Tomcat
echo 拷贝工程中编译好的文件到Tomcat\webapps
xcopy %WORK_SPACE%\%PRJ_WEB_ROOT% %CATALINA_HOME%\webapps\%WEB_NAME% /S /E /F /A
xcopy %WORK_SPACE%\%PRJ_NAME%\%BIN% %CATALINA_HOME%\webapps\%WEB_NAME%\WEB-INF /S /E /F /A
@REM 启动Tomcat
echo 启动Tomcat
cd %CATALINA_HOME%\bin
call startup.bat