记录下如何在pom.xml中配置插件,通过tomcat、Jetty运行项目.
配置pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat6-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
测试
Maven Tomcat plugin
$ mvn tomcat:run
$ mvn tomcat7:run
Maven Jetty plugin
$ mvn jetty:run