之前咱們在調試web項目的時候,須要在本地下載一個tomcat,爲了項目的複用性,方便他人快速調試,這裏演示一個用maven插件啓動web項目的方法java
在pom文件中加入以下插件web
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<port>8080</port>
<path>/</path>
<uriEncoding>UTF-8</uriEncoding>
<server>tomcat7</server>
</configuration>
</plugin>
</plugins>
複製代碼
端口,項目跟路徑之類的均可以配置apache
執行以下命令便可啓動tomcat
mvn tomcat7:run
複製代碼
或者點擊idea側邊欄maven中的插件按鈕 maven
用上面的方式啓動的話沒法調試源代碼,能夠簡單配置一下。ide
1.點擊Edit Congigurations idea