Deploy war on tomcat to another folder name
I'd like know is there a way to deploy war copied to webapps folder with another name, of course automatically,开发者_C百科 and with minimal configuration some xml files.
Example: I have a.war and want AServer folder and service but don't "a" folder and service
Thanks Pavel
EDIT 29.9.11 (7:30): I have something like this for copying in server.xml
<Context docBase="a" path="/AServer" reloadable="true" source="org.eclipse.jst.jee.server:a" />
it's be good if exist some parameters thats delete a folder or some other xml thats disable starting "a" server
EDIT 29.9.11 (14:53) I found some way. Added deployIgnore="a.war, a" parameters to server.xml - Host and Context is almost same and almost working (doesn't read a context in conf/Catalina/localhost), but still a folder exist to and probably this is not a good way.
<Context docBase="a" path="/AServer" reloadable="true" />
Have someone better way?
From Tomcat's The Context Container documentation:
path
...
This attribute must only be used when statically defining a Context in server.xml. In all other circumstances, the path will be inferred from the filenames used for either the .xml context file or the docBase.
One solution is renaming the war file. Another is unzipping it to the AServer
folder as @mooreds suggested.
Unzip the a.war file, move it to AServer, and remove the a.war file and folder.
There are ant takss for unzipping, moving and deleting that can automate this.
精彩评论