I didn't find how to resolve the issue via overlays. So I had to use two plugins maven-dependency-plugin and maven-war-plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<id>copy</id>
<phase>process-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.mygroup</groupId>
<artifactId>my_comp</artifactId>
<type>war</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/tmp</outputDirectory>
<includes>WEB-INF/folder1/folder2/file.xml</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1-beta-1</version>
<configuration>
<webResources>
<resource>
<directory>${project.build.directory}/tmp/WEB-INF/folder1/folder2</directory>
<targetPath>WEB-INF/otherFolder</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
The first plugin attached to the process-resources phase. The second invoked on phase package when all overlays combined. Overlays are applied with a first-win strategy (hence if a file has been copied by an overlay, it won't be copied anymore) If I've copy my file.xml (via plugin) then it not be overwritten by any overlay.
It's so complicated!