After trying for a while I noticed the <resources> are not overridden if there is a profile that contains the same <directory>, for example:
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>dir1/**.json</exclude>
<exclude>dir2/*.sh</exclude>
</excludes>
<filtering>true</filtering>
</resource>
</resources>
<!-- plugins and other stuff-->
</build>
If want to have something different in another profile:
<profile>
<id>ci</id>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>dir1/**.json</exclude>
<exclude>dir1/*.js</exclude>
<exclude>dir1/*.css</exclude>
<exclude>dir2/*.sh</exclude>
</excludes>
<filtering>true</filtering>
</resource>
</resources>
</build>
</profile>
maven clean package -Pci seems to ignore the resources specified in the profile, and works the same as without the profile.
Any suggestions to work around this ?
Thanks.

