2011-08-18 56 views
1

我有一个使用Tomcat库的Web应用程序。我没有将Tomcat库中的jar文件复制到web-inf/lib目录中。在Webapp项目中使用Tomcat库

现在,当我运行一个ant build/testNG类时,它会抛出一个错误,因为相关的jar不存在于web-inf/lib目录下。

是否有任何方式(配置),我可以使用Tomcat库运行ant build/testNG类。

由于提前,

维韦克

回答

1

<testng>任务,只需要提供Tomcat的库as additional classpath elements

<TestNG> 
    <classpath> 
     <pathelement path="${classpath}"/> 
     <pathelement location="path/to/tomcat/lib.jar"/> 
    </classpath> 
</TestNG> 
+0

@Vivek那么也许你应该[接受答案】(http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) –

+0

我已经接受了回答:) – Vivek

+0

@Vivek不要在评论中写这个。相反:或者更新你的问题,或者(更好)提出一个新问题。和:谢谢:-) –