测试管理,自动化测试、手机客户端测试、wap站点测试研究
maven+tomcat项目在eclipse下调试方法
上一篇 /
下一篇 2012-05-10 17:45:48
/ 个人分类:敏捷测试
maven结构的tomcat项目需要在eclipse下调试
51Testing软件测试网0cT&B@5q;y8p51Testing软件测试网p#c0x*I*sm0?
u1、正常创建tomcat项目,并设置为maven结构
c
a1H9H_{W0iN3vt1[&j+m Q02、在maven的pom.xml的plugins中添加下面一段
51Testing软件测试网&j`#e.a!g/?WG <plugin>
51Testing软件测试网f^8MYh_
r <groupId>org.codehaus.mojo</groupId>
51Testing软件测试网4cQnyH <artifactId>tomcat-maven-plugin</artifactId>
9y
r,`'c!X
^,G~0 <version>1.1</version>
9H2s1a6VHf;Ub^V4H
|0 </plugin>
%P9Or3o!]BwG+Kh0e@$g3l4O7@1d03、项目邮件选择-run as-run configuration-maven build,新建一个maven build,设置base directory为项目的路径,goals为tomcat:run
51Testing软件测试网&M8qRe@T51Testing软件测试网D%M`5QTH/cG4、启动maven项目,选择run as-maven build(或者debug as-maven build)
%JY-vyZX"d4~+Md051Testing软件测试网1d+^w'm.f9E7c5、如果出现
cannot be cast to javax.servlet.Filter错误(依赖的servlet api包与tomcat自带的jar包冲突),需要检查下对servlet的依赖,只要将scope设置为provided即可,如下所示:51Testing软件测试网v}~!G0skG
<dependency>51Testing软件测试网(riF`"a s
<groupId>javax.servlet</groupId>
)u0XM0ZG3Gu@d2rt^0 <artifactId>servlet-api</artifactId>
f*c#I B;x7O(f0 <version>2.4</version>
m!Te*|6S \0 <scope>provided</scope>
x(O n%cf'E0 </dependency>51Testing软件测试网R%Ijmb$n
51Testing软件测试网x"xvzyHN.M
收藏
举报
TAG: