I have created a war file and put into tomcat/webapps
. How to deploy a war file to tomcat using command prompt?
To do this, we need to place the WAR file inside the Tomcat CATALINA_HOME/WEBAPPS/
directory. Later, Tomcat will automatically deploy and explode this WAR file.
CATALINA_HOME
variable to the path of the Tomcat directorySyntax to copy the WAR file from the current directory in the command line:
copy %CATALINA_HOME%\
Example:
cd C:\MY_WAR_FILE_LOCATION
set CATALINA_HOME="C:\Program Files\Apache\apache-tomcat-7.0.42"
copy MYWARFILE.WAR %CATALINA_HOME%\webapps
Note: If a WAR file is copied into the webapps directory while Tomcat is running, it will not be recognized. Simply restart Tomcat to begin using the web application.