title: Dynamically loading jar class library with all of its dependencies
body: <p>I have a jar called x.jar</p>
  
  <p>all of the jar's dependencies are placed inside the jar using 
  maven-shade-plugin.</p>
  
  <p>I also previously tried using maven-assembly-plugin or maven-one-jar-plugin</p>
  
  <p>in y.jar I try using a Class-loader like presented in the following question:
  <a href="https://stackoverflow.com/questions/60764/how-should-i-load-jars-dynamically-at-runtime">How should I load Jars dynamically at runtime?</a></p>
  
  <p>when i load x.jar into y.jar in runtime, it cannot find the library dependencies inside of y.jar, so it crashes.</p>
  
  <p>how do i load x.jar in a way that it works as a class library with all of its dependencies?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <ul>
  <li>running the library statically from another project works fine and
  all of the dependencies work ok.  </li>
  <li>adding the dependencies into y.jar
  solves it, but i do not want them there. </li>
  <li>i do not want y.jar to know
  about x.jar dependencies</li>
  </ul>