------ Including and excluding files and directories ------ Franz Allan See ------ 2008-09-05 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Including and excluding files and directories When specifying a resource directory, every file within that directory may not be used. Thus, we may have to specify only the files that we want to include or specify the files that we want to exclude. To include a resource, we only need to add an <<<\>>> element. +-----+ ... My Resources Plugin Practice Project ... ... [your directory] [resource file #1] [resource file #2] [resource file #3] ... [resource file #n] ... ... ... +-----+ And to exclude a resource, we only need to add an <<<\>>> element. +-----+ ... My Resources Plugin Practice Project ... ... [your directory] [non-resource file #1] [non-resource file #2] [non-resource file #3] ... [non-resource file #n] ... ... ... +-----+ For example, if we want to include all text and RTF files under our <<>> directory and in all its subdirectories, we can do the following: +-----+ ... My Resources Plugin Practice Project ... ... src/my-resources **/*.txt **/*.rtf ... ... ... +-----+ Also, if we want to include everything except the bitmaps, jpegs, and gifs, we can simply exclude them by: +-----+ ... My Resources Plugin Practice Project ... ... src/my-resources **/*.bmp **/*.jpg **/*.jpeg **/*.gif ... ... ... +-----+ Of course, we can also have both <<<\>>> and <<<\>>> elements. For example, if we want to include all text files that does not contain the word "test" in their filename. +-----+ ... My Resources Plugin Practice Project ... ... src/my-resources **/*.txt **/*test*.* ... ... ... +-----+