Tomcat 8 integration with Maven

后端 未结 4 456
感情败类
感情败类 2020-12-25 15:25

It sounds like Eclipse (Kepler) does not have a proper plugin for Tomcat 8. I want to deploy my .war into Tomcat 8 and run it by Maven pom.xml file. Can anyone provide me st

4条回答
  •  悲哀的现实
    2020-12-25 16:08

    Just in case you use a separate Tomcat local server. If you use embedded tomcat, this is not applicable.

    In your pom.xml, add the tomcat plugin. (You can use this for both Tomcat 7 and 8):

    pom.xml

      
      
     org.apache.tomcat.maven  
     tomcat7-maven-plugin  
     2.2  
       
      http:// localhost:8080/manager/text  
      TomcatServer    *(From maven > settings.xml)*
      *yourtomcatusername*  
      *yourtomcatpassword*   
        
       
    

    tomcat-users.xml

    
          
               
              
    
    

    settings.xml (maven > conf)

      
        
           TomcatServer
           admin
           password
        
      
    

    * deploy/re-deploy

    mvn tomcat7:deploy OR mvn tomcat7:redeploy

    Tried this on (Both Ubuntu and Windows 8/10):
    * Jdk 7 & Tomcat 7
    * Jdk 7 & Tomcat 8
    * Jdk 8 & Tomcat 7
    * Jdk 8 & Tomcat 8

    Tested on Both Jdk 7/8 & Tomcat 7/8. (Works with Tomcat 8.5 Also, will test Tomcat 9 soon)

    Note:
    Tomcat manager should be running or properly setup, before you can use it with maven.

提交回复
热议问题