测试管理,自动化测试、手机客户端测试、wap站点测试研究
maven+tomcat项目在eclipse下调试方法
上一篇 /
下一篇 2012-05-10 17:45:48
/ 个人分类:敏捷测试
maven结构的tomcat项目需要在eclipse下调试
51Testing软件测试网o_\asjf6r51Testing软件测试网iIoT E2q-Sy1、正常创建tomcat项目,并设置为maven结构
WU`4{LV-I051Testing软件测试网$P6I K(I1vWgv2、在maven的pom.xml的plugins中添加下面一段
51Testing软件测试网a!T(l FTqyG/Q <plugin>
|yT9T9c0v!a'i0 <groupId>org.codehaus.mojo</groupId>
jl
g\p0 <artifactId>tomcat-maven-plugin</artifactId>
oV(\o'?
Q+i
a$~0 <version>1.1</version>
0F9hY"l2EQ$C0 </plugin>
51Testing软件测试网0n~}"Yfl
u1z?9o1T9sKbk$W03、项目邮件选择-run as-run configuration-maven build,新建一个maven build,设置base directory为项目的路径,goals为tomcat:run
51Testing软件测试网\S xY7rw;D`jG51Testing软件测试网GV1z4x4w4、启动maven项目,选择run as-maven build(或者debug as-maven build)
d~D?Z07SA
Ba-ra VUT^05、如果出现
cannot be cast to javax.servlet.Filter错误(依赖的servlet api包与tomcat自带的jar包冲突),需要检查下对servlet的依赖,只要将scope设置为provided即可,如下所示:
;t+w[w{:LW_u0 <dependency>51Testing软件测试网E;K,L-k4Ap(y
<groupId>javax.servlet</groupId>
{9Q$Z9ntiy0 <artifactId>servlet-api</artifactId>
6_*B%HB-p#x0 <version>2.4</version>
ra)pB ^@-TW0 <scope>provided</scope>
c-^%D+_bI*Ah/{e0 </dependency>
r0G ro4@aTT0y Du8NU?0
收藏
举报
TAG: