We use TomEE in several applications, and to speed up builds and standardize our deployments, we use the Maven plugin to create a TomEE zip already configured with our libraries and configuration files and publish it to our internal maven repo.
We then use the TomEE maven plugin in each project to pull in this custom build and deploy our application into it. However the current maven plugin will overwrite the conf/tomee.xml file that we have packaged. This happens because the plugin is trying to be helpful by adding the '<Deployments dir="apps" />' tag, which is not enabled in the file that ships with the original zip, however it does this by writing out a whole new file with this tag. There are many ways to go about solving this issue, the one I came up with is in the attached patch, developed against 2.0. This does a more surgical update of an existing tomee.xml file without touching over any existing changes. If this needs further changes or refinement in order to be accepted into the project I'd be glad to continue to work on it based on feedback. - Adam Cornett
