I have 3 wars in my webapp folder. Two of them are built on services of the third one. I\'m in a testing environment, i.e. I don\'t have control over their architectures, so
There are three ways to deploy the webapp.war
in Tomcat.
Add Context
element inside a Host
element in the $CATALINA_BASE/conf/server.xml
file.
Create the $CATALINA_BASE/conf/[engineName]/[hostName]/[webappName].xml
file with content:
Add the webapp.war
file directly in the $CATALINA_BASE/webapps/
directory.
The following deployment sequence will occur on Tomcat startup:
1→2→3
Some explanations:
$CATALINA_BASE
Refer the base directory against which most relative paths are resolved. If you have not configured Tomcat for multiple instances by setting a CATALINA_BASE directory, then $CATALINA_BASE will be set to the value of $CATALINA_HOME, the directory into which you have installed Tomcat.
docBase
The pathname to the web application WAR file. You may specify an absolute pathname for this WAR file, or a pathname that is relative to the appBase directory of the owning Host.
engineName:
The name of the engine associated to the context. The default name is Catalina
.
hostName:
The name of the host associated to the context. The default name is localhost
.
Assume that:
a.war
, b.war
and c.war
.b.war
depends on a.war
.c.war
depends on b.war
.Try the following steps:
$CATALINA_BASE/webapps/
directory.create the $CATALINA_BASE/conf/Catalina/localhost/b.xml
file with content:
Add Context
element in the $CATALINA_BASE/conf/server.xml
file:
Reference: