I'm going to explain what i discovered with the help of the debug flag (mvn -X clean install
).
Default values are:
<workDirectory default-value="${project.build.directory}/war/work"/>
<cacheFile default-value="${project.build.directory}/war/work/webapp-cache.xml"/>
As stated in maven war plugin's doc, workDirectory parameter is where where overlays will be temporarily extracted; changing it will not affect the path of the cache's file.
Instead, adding a cacheFile tag to configuration
<configuration>
<useCache>true</useCache>
<cacheFile>/customdir/webapp-cache.xml</cacheFile>
</configuration>
will override the cache's final position, resulting in:
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-war-plugin:2.4:war' with basic configurator -->
[DEBUG] (s) archiveClasses = false
[DEBUG] (s) attachClasses = true
[DEBUG] (s) cacheFile = C:\customdir\webapp-cache.xml
Regards, PaoloC