Maven : Filter only a given type of files

As I lost 5 minutes with this problem which is basic I share it here to help others.
By default, the Maven resources plugin copy everything from src/[main|test]/resources into target/classes without touching anything.
If you want to filter only a given type of files (to speedup the process and to avoid to corrupt binary files for example) you’ll need activate the filtering for this type of files (using inclusions) and the default configuration for others files (using exclusions).
Here is a sample to filter only *.properties resources :


<resources>
<!-- Filter only property files -->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes><include>**/*.properties</include></includes>
</resource>
<!-- Everything is using the default copy -->
<resource>
<directory>src/main/resources</directory>
<excludes><exclude>**/*.properties</exclude></excludes>
</resource>
</resources>