I have this setup currently:
Project A outputs a war file - has a configuration file (WEB-INF/web.xml). We've been delivering this with a commented out section of configuration which gets uncommented manually when the project is deployed in a particular environment.
Needs of the project have changed - and I need Project A to be built without that section of configuration entirely; and I need another project (Project B) to be built WITH that section of configuration (enabled, not commented out).
Rather than having the file exist in both projects (dual maintenance), I had hoped I could have Project B depend on Project A (via war overlay), and then use the maven-config-processor-plugin to add my special config to WEB-INF/web.xml, then re-package the war file.
This doesn't seem to work - though - the config modification can work if the target already exists (i.e. after the previous run), but when I run everything together, the overlay and repackaging into the new war happens together - and I can't figure out any way to make the config-processor plugin operate in the middle. Basically, the default order ends up being "config-processor" (which fails because the overlay hasn't happened yet), then "war" (all as one unit). I can't make the config-processor happen after the overlay but before the war is fully packaged.
Multiple people on the internets have asked over the last few years if there is a way to inject a plugin in between the "unpack the overlay" and "repack the war file" steps, but nobody has seemingly answered this definitively either way. Any ideas?