user2040500
user2040500

Reputation:

deploying war file in tomcat through command prompt

can anyone please tell me how to deploy a war in tomcat through command prompt. i'm using windows as OS.

i've deployed war using gui but don't know how to do that through command prompt.

Upvotes: 0

Views: 10019

Answers (1)

A4L
A4L

Reputation: 17595

Maybe just as simple as

copy <your-war> %CATALINA_HOME%\<appBase>

and make sure autoDeploy is true in the Host element in the server.xml config file. By default it is true. appBase is also an attribute of the Host element and is per default webapps.

This assumes that you can access using the filesystem. Otherwise you have to use a tool like Ant or Maven

EDIT

@ECHO OFF
REM deploy.bat
SET CATALINA_HOME="C:\Program Files\Apache\apache-tomcat-7.0.42"
copy /Y %1 %CATALINA_HOME%\webapps

copy paste the above code to a file deploy.bat, set CATALINA_HOME to the installation directory of your tomcat, save and call it in a command prompt like like this:

deploy.bat my_webapp.war

Upvotes: 2

Related Questions