2 回答

TA貢獻1853條經驗 獲得超9個贊
這個來個實例最好了
1 2 3 4 5 6 7 8 9 10 | <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> </configuration> </plugin> |
簡要說明一下:
path 是訪問應用的路徑
port 是tomcat 的端口號
uriEncoding URL按UTF-8進行編碼,這樣就解決了中文參數亂碼。
配置就這么簡單,基本搞掂,下面看看如何使用。
插件運行
如果Eclipse 安裝了Maven插件,選 擇pom.xml文件,擊右鍵——>選擇 Run As——> Maven build 。
如果是第一次運行,會彈出下面對話框。在Goals框加加入以下命令: tomcat7:run

TA貢獻1804條經驗 獲得超2個贊
在tomcat插件中配置的,我們項目中是這樣配置的:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<port>8080</port>
<uriEncoding>UTF-8</uriEncoding>
<path>/oa</path>
</configuration>
</plugin>
- 2 回答
- 0 關注
- 1816 瀏覽
添加回答
舉報