title: Loading a jar's context.xml from classpath
body: <p>I'm trying to load an application context which is inside a jar as a plugin. I use this to load the context:</p>
  
  <pre><code>ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath*:**my-context.xml");
  </code></pre>
  
  <p>When I load the jar through pom.xml, it works fine.</p>
  
  <p>Then I add it directly in the classpath using eclipse instead of maven to avoid to compile every time (ultimate goal is the shared lib folder in tomcat, not working too). Now spring is unable to find it and return a default context (no exception)</p>
  
  <p>I checked that it's correctly insert in the classpath using:</p>
  
  <pre><code>InputStream in1 = this.getClass().getClassLoader().getResourceAsStream("my-context.xml");
  </code></pre>
  
  <p>It works.</p>
  
  <p>I checked logs. Using the pom.xml, spring is correctly searching in the jar</p>
  
  <pre><code>Searching directory  [...target\classes\META-INF\maven\x.y.z] for files matching pattern [...\x.y.z/target/classes/**/my-context.xml]
  Searching directory  [...ehealth.poc.module1] for files matching pattern [D:/JRB/Projects/Vivates/workspaces/default/extcom/ehealth.poc.module1/target/classes/**/ecm-context.xml]
  ...
  Resolved location pattern [classpath*:**/my-context.xml] to resources [file [...\target\classes\my-context.xml]]
  Loading XML bean definitions from file [...\target\classes\my-context.xml]
  ...
  </code></pre>
  
  <p>In the second case, nothing in the log about my jar.</p>
  
  <p>Why spring does not have the same behavior when I use maven or directly the classpath? I maven doing something else than simple adding dependencies location in the classpath?</p>