Skip to Main Content
Apache Maven Cookbook
book

Apache Maven Cookbook

by Raghuram Bharathan
April 2015
Intermediate to advanced content levelIntermediate to advanced
272 pages
4h 59m
English
Packt Publishing
Content preview from Apache Maven Cookbook

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> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Apache Maven 3

Mastering Apache Maven 3

Prabath Siriwardena
Learning Apache Maven

Learning Apache Maven

Kevin Bowersox

Publisher Resources

ISBN: 9781785286124Supplemental Content