Publish web applications to Tomcat using batch processing under windows and start Tomcat

Reprinted from: http://blog.csdn.net/lanpiao_87/article/details/7467802

 

wrote
@ECHO OFF
@REM Deploy the WEB system to Tomcat
set date=%date:~0,10%
set time=%time:~0,8%
set currDate=%date% %time%
echo Start running and compile it in the workspace Copy the code to Tomcat...%currDate%

echo set parameters
set WORK_SPACE=J:\Piao\IT\workspace
set PRJ_NAME=MyStruts1Prj
set PRJ_WEB_ROOT=MyStruts1Prj\WebContent
set BIN=build
set CATALINA_HOME=J:\Piao\IT\ tools\tomcat6_0_3_5
set WEB_NAME=webapp

@REM Delete the previous
echo Delete the existing
cd %CATALINA_HOME%\webapps
if exist %WEB_NAME% rd /s /q %WEB_NAME%

@REM Create a new
md %WEB_NAME%

@REM Copy the project and compile it file to Tomcat
echo Copy the compiled files in the project to 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

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327066739&siteId=291194637