使用maven的tomcat插件運行項目


maven中提供了tomcat7-maven-plugin插件,可以不用配置本地tomcat服務器。

1、在pom中添加配置

 1 <build>
 2             <!-- 本地tomcat7插件 -->
 3             <plugin>
 4                 <groupId>org.apache.tomcat.maven</groupId>
 5                 <artifactId>tomcat7-maven-plugin</artifactId>
 6                 <version>2.1</version>
 7                 <configuration>
 8                     <path>/</path>
 9                     <uriEncoding>UTF-8</uriEncoding>
10                     <port>8888</port>
11                 </configuration>
12             </plugin>
13         </plugins>
14     </build>
pom.xml

 2、設置maven命令行

點擊工具欄run->edit configurations,出現如下窗口;輸入tomcat7:run

 


免責聲明!

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



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