After digging around for ages and trying different configurations I finally found what works.
Using mvn clean install -X on the child that is overlaying the parent I confirmed the files were being copied as there was a "+" symbol instead of a "-". In fact the files I though were being excluded because of the exclude block where actually excluded because the child has a file with the same name in the same location.
Eventually I looked in the plugin.xml for the maven-war-plugin-2.2.jar and I found this parameter: dependentWarExcludes which according to the xml is:
<deprecated>Use <overlay><excludes>
instead</deprecated>
As can be seen in my question above I tried to use <exclude>
in <overlay>
as recommended but that was actually not working for anything. In the end dependentWarExcludes worked after restructuring the plugin block as follows:
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<overlays>
<overlay>
<groupId>com.mycompany.Online</groupId>
<artifactId>MyCompanyOnline</artifactId>
</overlay>
</overlays>
<dependentWarExcludes>WEB-INF/web.xml,WEB-INF/applicationContext.xml,WEB-INF/wro/</dependentWarExcludes>
</configuration>
<executions>
<execution>
<id>build-directory-tree</id>
<phase>process-resources</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
</plugin>