Maven Deploy To Multiple Tomcat Servers

前端 未结 5 1890
轻奢々
轻奢々 2020-12-23 00:18

What is the most minimal example of deploying a war to multiple tomcat servers using maven that can be written?

I\'ve tried the following URLs and asked the mailing

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-23 00:44

    This is quite a late answer to an old question, but I am pretty sure people will be interested in it. I just achieved to run multiple deployments using maven and ant tasks. The secret is to use a macrodef (or 2 for me as I hot deploy my apps in jetty and need to transfer a war and a xml file) and using a ant property file :

    
        maven-antrun-plugin
        1.7
        
            
                install
                
                    
                        
                        
                            
                            
                            
                            
                            
                            
                            
                                
                                
                                
                            
                        
                        
                            
                            
                                
                                
                                
                                                                     
                            
                                                     
                             
                        
                    
                
                
                    run
                
            
        
    
    

    Then you property file needs to be something like :

    home.jetty.server.user=
    home.jetty.server.port=
    home.jetty.server.host=
    home.jetty.server.baseDir=
    home.jetty.server.webappsDir=
    home.jetty.server.contextDir=
    home.jetty.server.passphrase=
    wap.jetty.server.user=
    wap.jetty.server.port=
    wap.jetty.server.host=
    wap.jetty.server.baseDir=
    wap.jetty.server.webappsDir=
    wap.jetty.server.contextDir=
    wap.jetty.server.passphrase=
    

    etc... on a block of option per server config used by

    
    

    The trick is that macrodef attribute using @{} as precedence over property evaluation ${} in ant.

提交回复
热议问题