IDEA 社区版集成TOMCAT

直接在POM.XML中添加以下内容

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.2</version>
    <configuration>
        <port>8888</port>
        <path>/</path>
        <contextFile>src/main/webapp/META-INF/context.xml</contextFile>
    </configuration>
</plugin>

该插件会自动下载一个嵌入式的TOMCAT,可以在configuration配置节里面对这个嵌入式的TOMCAT配置端口,目录和content.xml信息。

要运行这个TOMCAT,需要在IDEA-RUN-DEBUG,editconfiguration,新增-MAVEN,名称输入TOMCAT7,commandline为:tomcat7:run

关于tomcat7-maven-plugin的官方信息见:http://tomcat.apache.org/maven-plugin-trunk/tomcat7-maven-plugin/usage.html

猜你喜欢

转载自www.cnblogs.com/yesok/p/9938373.html