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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM