tomcat7-maven-plugin 使用
pom :
<!-- 配置tomcat插件 -->
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<port>8080</port>
<path>/</path>
<uriEncoding>UTF-8</uriEncoding>
<server>tomcat7</server>
</configuration>
</plugin>
</plugins>
</build>
注意 :
- path :是访问应用的路径 。例如我上面写的是/SSM,则访问路径是 http://localhost/SSM
- port 是tomcat 的端口号
- uriEncoding URL按UTF-8进行编码,这样就解决了中文参数乱码。
- Server 指定tomcat名称。
重点
此时运行的时候只需要右击右边的命令,然后可以以 run模式 或者 debug模式 启动项目,debug模式可以打断点进行调试
或者:
点击Run-》Edit Configurations后搜索maven
Debug工程
1、 打个断点
2、 Debug模式启动manager
3、 正常模式启动web
出现Debug超时,是由于Dubbo默认是一秒钟,服务端不给响应,就超时了,可以配置一下
可以设置服务超时时间:
服务调用超时时间默认1秒,