59451

Use Tomcat Library in Webapp project

Question:

I have a web application that uses the Tomcat library. I have not copied the jars from the Tomcat library into the web-inf/lib directory.

Now when I run an ant build / testNG class, it throws an error since the concerned jars are not present under the web-inf/lib directory.

Is there any way (configuration) that I can use the Tomcat library for the running the ant build / testNG classes.

Thanks in advance,

Vivek

Answer1:

In the <a href="http://testng.org/doc/ant.html" rel="nofollow"><testng></a> task, just provide the tomcat libraries <a href="http://ant.apache.org/manual/using.html#path" rel="nofollow">as additional classpath elements</a>.

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

Recommend

  • Gradle TestNG Task is not create test-output folder
  • Can we build an application using selenium webdriver?
  • How can I set default reporters for TestNg from Intellij?
  • Run as TestNG Suite not working in eclipse
  • Unable to get Emma Coverage for Android [duplicate]
  • How to sync a PHP project using RSync and NetBeans?
  • Ant: fileset “dir” attribute with a runtime expanded full path
  • why does .next() give me 'undefined'
  • Passing information to server-side function in a Google Docs Add On
  • What's the syntax to inherit documentation from another indexer?
  • Authentication failed with Azure Active Directory in Windows Phone
  • Cast between interfaces whose interface signatures are same
  • TextToSpeech.setEngineByPackageName() triggers NullPointerException
  • Spring Cloud Microservice Architecture Confusion
  • Creating Java object from class name with constructor, which contains parameters [duplicate]
  • Ensure fsync did its job
  • How to use RequestBodyAdvice
  • Installing Hadoop, Java Exception about illegal characters at index 7?
  • How can I send an e-mail from a vbs script
  • Is there any way to access browser form field suggestions from JavaScript?
  • Array.prototype.includes - not transformed with babel
  • Convert array of 8 bytes to signed long in C++
  • jQuery tmpl and DataLink beta
  • SVN: Merging two branches together
  • Hibernate gives error error as “Access to DialectResolutionInfo cannot be null when 'hibernate.
  • Is there a mandatory requirement to switch app.yaml?
  • Hits per day in Google Big Query
  • -fvisibility=hidden not passed by compiler for Debug builds
  • FormattedException instead of throw new Exception(string.Format(…)) in .NET
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • Java static initializers and reflection
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • Linking SubReports Without LinkChild/LinkMaster
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]
  • unknown Exception android
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass
  • Observable and ngFor in Angular 2
  • UserPrincipal.Current returns apppool on IIS
  • Unable to use reactive element in my shiny app
  • Net Present Value in Excel for Grouped Recurring CF