Tomcat 8 Maven Plugin for Java 8

前端 未结 6 1363
臣服心动
臣服心动 2020-11-28 04:58

Is the tomcat7-maven-plugin working with a tomcat 8 server and java 8? I can\'t find any tomcat8-maven-plugin.

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-28 05:37

    Yes you can,

    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
    * Jdk 8 & Tomcat 9

    Tested on Both Jdk 7/8 & Tomcat 7/8. (Works with Tomcat 8.5 and 9)

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

    Good Luck!

提交回复
热议问题