Deployment of war file on Tomcat

后端 未结 6 1103
野趣味
野趣味 2021-01-31 20:05

Is there a way to deploy a given war file on Tomcat server? I want to do this without using the web interface.

6条回答
  •  一个人的身影
    2021-01-31 20:45

    There are several ways to deploy a Tomcat webapp:

    • Dropping into $CATALINA_HOME/webapps, as was already mentioned.
    • Using your build scripts to deploy automatically via the manager interface (that comes with Tomcat). Here are the two ways
      • for Maven: use the tomcat plugin. You don't need to include it in pom.xml, just issue the goal mvn tomcat:deploy, the plugin is included in Maven 2. This assumes several defaults explained in the documentation, you can configure the behaviour in the pom.xml. There are other goals that let you deploy as an exploded archive etc.
      • for Ant: something like this:
        
        
        
        
        
        
        
        
        
        
            
        
        
            
        
        
            
        
        
            
        
    

    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.

提交回复
热议问题