title: How does a classloader load classes reference in the manifest classpath?
body: <p>I used maven to built a jar with an external classpath additions using <a href="http://maven.apache.org/shared/maven-archiver/examples/classpath.html">addClasspath</a>.</p>
  
  <p>When I run that jar using <code>java -jar artifact.jar</code> it is able to load classes from that main jar and from all jars in the libs directory.</p>
  
  <p>However if I ask the system property <code>java.class.path</code> it will only list the main jar. If I ask the system class loader for its urls (<code>ClassLoader.getSystemClassLoader().getURLs()</code>) it will also only return the main jar. If I ask any class contained in some library for its class loader it will return the system class loader.</p>
  
  <p>How is the system class loader able to load those classes?</p>
  
  <p>It has to have some knowledge about those libraries in order to load classes from those. Is there a way to ask it for this kind of "extended" classpath?</p>