maven web配置发布路径 cargo自动部署项目到tomcat
pom.xml中加入以下 配置发布路径
1 <build> 2 <!-- 发布名 www.locathost:8080/HelloWeb可以访问,如果改成ROOT那么 默认的tomcat也就能访问了 --> 3 <finalName>HelloWeb</finalName> 4 <plugins> 5 <plugin> 6 <groupId>org.codehaus.cargo</groupId> 7 <artifactId>cargo-maven2-plugin</artifactId> 8 <version>1.2.3</version> 9 <configuration> 10 <container> 11 <!-- tomcat类型 --> 12 <containerId>tomcat7x</containerId> 13 <!-- 指定tomcat路径 --> 14 <home>D:\Program Files\Java\Apache Tomcat\apache-tomcat-7.0.37-windows-x86\apache-tomcat-7.0.37</home> 15 </container> 16 <configuration> 17 <type>existing</type> 18 <!-- 指定tomcat路径 --> 19 <home>D:\Program Files\Java\Apache Tomcat\apache-tomcat-7.0.37-windows-x86\apache-tomcat-7.0.37</home> 20 </configuration> 21 22 </configuration> 23 <executions> 24 <execution> 25 <id>cargo-run</id> 26 <phase>install</phase> 27 <goals> 28 <goal>run</goal> 29 </goals> 30 </execution> 31 </executions> 32 </plugin> 33 </plugins> 34 </build>