title: Classloading problem in multimodule maven application
body: <p>I have multimodule maven application. Inside the main directory where parent pom resides I have some modules. I am in the process of adding another one on the same level as the other modules. The application is packages as EAR and deployed into Websphere, this EAR is configured to use shared library which basically is a directory containing jars. In this shared library Apache Crimson resides which is used by some of the modules. I am adding the new module based on Spring Framework 4.0.0.RELEASE. The whole project is a legacy and uses Java 6 and Hibernate 2.1 :( . The problem is that this Crimson make my new module crashing during deployment:</p>
  
  <blockquote>
    <p>BeanDefinitionStoreException: Parser configuration exception parsing
    XML from ServletContext resource [/WEB-INF/spring/root-context.xml];
    nested exception is javax.xml.parsers.ParserConfigurationException:
    Unable to validate using XSD: Your JAXP provider
    [org.apache.crimson.jaxp.DocumentBuilderFactoryImpl@706b4db8] does not
    support XML Schema. Are you running on Java 1.4 with Apache Crimson?
    Upgrade to Apache Xerces (or Java 1.5) for full XSD support.</p>
  </blockquote>
  
  <p>So I added to my new module this:</p>
  
  <pre><code>`&lt;dependency&gt;
      &lt;groupId&gt;xerces&lt;/groupId&gt;
      &lt;artifactId&gt;xercesImpl&lt;/artifactId&gt;
      &lt;version&gt;2.6.2&lt;/version&gt;
  &lt;/dependency`
  </code></pre>
  
  <p>But application still takes crimson.jar from the shared library. I tried to exclude this crimson.jar from parent pom but still it is taken from shared library.
  Crimson is required by some other modules being packaged as jars hence the crimson is present ar EAR/lib level.
  Another try was to change classloader order to take jars from the new module first and then go upward in the hierarchy (my new war module then parent ear). But this gave me some other exception.
  The question is - how being in WAR module inside EAR module not take the jar from the ear level (it was also included in EAR/lib) and take from the WAR level only?</p>