title: Specific Class Loader for different libs of one EAR
body: <p>I do have one EAR with one WAR within. Within this WAR in the WEB-INF/lib folder I do have a list of lib jars. Some of this lib jars are own code and a kind of plugin. This plugins extend the WAR by new features. The plugins are automatically detected with CDI features.</p>
  
  <p>All works fine so long.
  But the more work I spend to this plugins, the more I would like to have some common code for multiple plugins which is NOT part of the normal EAR/WAR common code. Also I would like to have different versions of this plugins (with different versions of this common plugin code).</p>
  
  <p>My idea is, to have one specific class loader for each of this plugins. This class loader should FIRST try to load from this plugin JAR. If the class/resource is not found within this JAR, the normal class loader of the EAR is asked for.</p>
  
  <p>Are there any solutions for this idea? Can I define a special class loader for one JAR?
  Or is the idea bad and you do have a better suggestion?</p>
  
  <p>Environment:</p>
  
  <ul>
  <li>JBoss 7.1.1</li>
  <li>JDK 1.6</li>
  </ul>