cargo-maven2-plugin上传部署到tomcat服务器

使用的是cargo-maven2-plugin插件,较为灵活的一个Deploy插件,具体配置如比上面的 tomcat-maven-plugin稍微有点儿复杂,部分还有不清楚,先写上以后再慢慢研究,配置如下:
Xml代码   收藏代码
  1. <build>         
  2.         <plugins>  
  3.         <plugin>  
  4.               
  5.             <groupId>org.codehaus.cargogroupId>  
  6.             <artifactId>cargo-maven2-pluginartifactId>  
  7.             <version>1.0.3version>  
  8.               
  9.               
  10.             <configuration>  
  11.                 <wait>truewait>         
  12.                 <container>                 
  13.                     <containerId>tomcat6xcontainerId>                 
  14.                     <type>installedtype>                                    
  15.                     <home>E:\webServers\apache-tomcat-6.0.32-testhome>      
  16.                 container>  
  17.                   
  18.                 <configuration>             
  19.                     <type>existingtype>                                     
  20.                     <home>E:\webServers\apache-tomcat-6.0.32-testhome>      
  21.                     <properties>                                            
  22.                         <cargo.tomcat.manager.url>http://localhost:8080/managercargo.tomcat.manager.url>        
  23.                         <cargo.remote.username>tomcatcargo.remote.username>                                     
  24.                         <cargo.remote.password>tomcatcargo.remote.password>                                     
  25.                         <cargo.tomcat.ajp.port>8009cargo.tomcat.ajp.port>                                       
  26.                     properties>  
  27.                 configuration>  
  28.                   
  29.                 <deployer>                                              
  30.                     <type>installedtype>                            
  31.                     <deployables>                                   
  32.                         <deployable>                                                
  33.                             <groupId>org.testgroupId>  
  34.                             <artifactId>testwebappartifactId>  
  35.                             <type>wartype>  
  36.                             <properties>  
  37.                                 <context>testwebappcontext>     
  38.                             properties>  
  39.                         deployable>  
  40.                     deployables>  
  41.                 deployer>  
  42.             configuration>  
  43.               
  44.             <executions>  
  45.                   
  46.                 <execution>  
  47.                     <id>verify-deployerid>  
  48.                     <phase>installphase>        
  49.                     <goals>  
  50.                         <goal>deployer-deploygoal>  
  51.                     goals>  
  52.                 execution>  
  53.                   
  54.                 <execution>  
  55.                     <id>clean-deployerid>  
  56.                     <phase>cleanphase>  
  57.                     <goals>  
  58.                         <goal>deployer-undeploygoal>  
  59.                     goals>  
  60.                 execution>  
  61.             executions>  
  62.         plugin>  
  63.     plugins>  
  64. build>  

不详细的解释在XML当中,直接运行mvn install OK!~~

你可能感兴趣的:(Maven技术)