Maven plugin for Tomcat 9

后端 未结 3 644
日久生厌
日久生厌 2021-02-01 15:56

I didn\'t find any tomcat-maven-plugin other than tomcat7-maven-plugin. Can I use it with apache-tomcat-9.0.0.M15?

3条回答
  •  醉话见心
    2021-02-01 16:12

    You can use the plugin to deploy to a separately running tomcat 9.

    The run goals won't work, but the deploy goals will.

    
        org.apache.tomcat.maven
        tomcat7-maven-plugin
        2.2
        
            http://localhost:8080/manager/text
            TomcatServer
            /myapp
        
    
    

    Maven goals:

    mvn tomcat7:deploy
    mvn tomcat7:undeploy
    mvn tomcat7:redeploy
    

    Note: Don't forget to add tomcat user in tomcat-users.xml and maven settings.xml

    tomcat-user.xml

    
    
      
      
      
    
    

    manager-script role enables applications i.e., maven, to deploy jar/war to application server.

    Maven file settings.xml

    
    
        
            
                TomcatServer
                admin
                password
            
        
    
    

提交回复
热议问题