title: How can I access a static resource under webapp from a JUnit test?
body: <p>I wrote a JUnit test that validates the xml returned by a service against its XSD. I initially put the XSD under <code>src/main/resrouces/xsd/&lt;filename&gt;.xsd</code> But now I'm facing the need to move it under <code>webapp</code>, as a static resource, so that it will be publicly accessible when the application is deployed.</p>
  
  <p>I'd rather not have two copies, as I expect that somebody will modify the wrong one sooner or later.</p>
  
  <p>I was loading the file with <code>getClass().getResource("/xsd/&lt;filename&gt;.xsd")</code>, how would I access it if the resource is moved under <code>webapp</code>?</p>