I've hit what seems to be a problem with classpath management with the maven-tomcat-plugin.
I have a webapp that includes xercesImpl 2.9.1. It includes some code that builds a DOM tree with XML Schema validation turned on. This all works fine when the code is run in a POJO unit test. Run from inside the webapp by tomcat:run, it fails. The failure mode seems to result from the use of a strange hybrid of building JDK JAXP classes and the xerces classes. I eventually got my code to work by introducing the JAXP 1.4 APIs to the webapp and then calling the newInstance(...) methods that allow me to very explicitly specify Xerces. My theory here is that the 'system' classpath of tomcat in the plugin is maven's classpath, not the project's classpath or a clean classpath. There's some loopy old version of xml-apis or something else on that classpath causing all this chaos. I suggest that the plugin should load tomcat, insofar as possible, in a clean classloader, or even a classloader with the same things in it as show up by default in the lib directory of the relevant version of tomcat.
