O'Reilly logo

Apache Maven Cookbook by Raghuram Bharathan

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

Including and excluding additional resources

There are many situations where you will need to include additional resource files or folders for compilation or testing. You might also have to exclude specific files or folders. Let us see how we can do this.

Getting ready

Maven is set up on your system and is verified for work. To do this, refer to the first three recipes of Chapter 1, Getting Started.

How to do it...

  1. Open one of the Maven projects for which we need to include or exclude files or folders; for instance, project-with-include-exclude.
  2. Add the following to the build section of your pom file:
    <resources> <resource> <directory>src/resources/xml</directory> <includes> <include>*.xml</include> </includes> </resource> <resource> <directory>src/resources/json</directory> ...

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