Is there a way to deploy a given war file on Tomcat server? I want to do this without using the web interface.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
There are several ways to deploy a Tomcat webapp:
pom.xml
, just issue the goalmvn tomcat:deploy
, the plugin is included in Maven 2. This assumes several defaults explained in the documentation, you can configure the behaviour in thepom.xml
. There are other goals that let you deploy as an exploded archive etc.All of those will require you to have a Tomcat user configuration. It lives
$CATALINA_BASE/conf/tomcat-users.xml
, but since you know already how to use the web interface, I assume you know how to configure the users and passwords.You can also try this command-line script for managing tomcat called tomcat-manager. It requires Python, and talks to the manager application included with tomcat via HTTP. You can do stuff from a *nix shell like:
and:
you can edit the conf/server.xml and add an entry like this pointing to your war directory
ELSE you can copy your .WAR file to the webapps directory of tomcat.
We never use the web interface, don't like it. The wars are dropped in the webapps and server.xml edited as necessary. You need to bounce it if you edit the server.xml, but the war file should be picked up automagically. We generally delete the directory expanded from the war first so there is no confusion from where the components came.
The Tomcat Client Deployer Package looks to be what you need to deploy to a remote server from the command line. From the page:
Just copy the war file into the $TOMCAT_HOME/webapps/ directory. Tomcat will deploy the war file by automatically exploding it. FYI - If you want you can make updates directly to the exploded directory, which is useful for development.