O'Reilly logo

Arquillian Testing Guide by John D. Ament

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing libraries and modules

Usually, if you're building a web application, you'll have some kind of library that you use. Whether it's a large framework such as Spring or Hibernate, or something more refined such as PrimeFaces or Apache Commons Email, you'll need to bring in some set of JAR files to your web application.

One way to add these libraries to your application is to use the relative path. Take a look at this code snippet:

public File[] getWebInfLibs() {
  File dir = new File("target/my-app/WEB-INF/lib");
  return dir.listFiles();
}

Assuming that you are using Maven, this will give you all files that were in your exploded directory's WEB-INF/lib directory. These files do get copied in place early enough in the build that they should be ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required