测试管理,自动化测试、手机客户端测试、wap站点测试研究

maven+tomcat项目在eclipse下调试方法

上一篇 / 下一篇  2012-05-10 17:45:48 / 个人分类:敏捷测试

maven结构的tomcat项目需要在eclipse下调试51Testing软件测试网0cT&B@5q;y8p
51Testing软件测试网p#c0x*I*s m0? u
1、正常创建tomcat项目,并设置为maven结构
c a1H9H_{W0
iN3vt1[&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>
9H2s1a6VH f;Ub^V4H |0            </plugin>
%P9Or3o!]BwG+Kh0
e@$g3l4O7@1d03、项目邮件选择-run as-run configuration-maven build,新建一个maven build,设置base directory为项目的路径,goals为tomcat:run51Testing软件测试网&M8qRe@T
51Testing软件测试网D%M`5QTH/cG
4、启动maven项目,选择run as-maven build(或者debug as-maven build)
%JY-vyZ X"d4~+Md051Testing软件测试网1d+^w'm.f9E7c
5、如果出现cannot be cast to javax.servlet.Filter错误(依赖的servlet  api包与tomcat自带的jar包冲突),需要检查下对servlet的依赖,只要将scope设置为provided即可,如下所示:51Testing软件测试网v}~!G0skG
        <dependency>51Testing软件测试网(riF`"as
            <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(On%cf'E0        </dependency>51Testing软件测试网R%Ijmb$n
51Testing软件测试网x"xvzyHN.M

TAG:

 

评分:0

我来说两句

Open Toolbar