[jboss-user] [Javassist user questions] - Re: Using Javassist inside Mojo [RESOLVED]

ad-rocha do-not-reply at jboss.com
Fri Jun 5 08:05:22 EDT 2009


You´re righit Chiba. The code below did the trick. Thank you very much for your help!


  | ClassWorld world = new ClassWorld();
  | 
  | ClassRealm realm = world.newRealm("org.codecompany.jeha.plugin", 
  |    Thread.currentThread().getContextClassLoader());
  | 
  | ClassRealm runRealm = realm.createChildRealm("runenv");
  | 
  | Set<Artifact> artifacts = project.getDependencyArtifacts();
  | for (Artifact artifact : artifacts) {
  |    runRealm.addConstituent(artifact.getFile().toURI().toURL());
  | }				
  | 
  | Thread.currentThread().setContextClassLoader(
  |    runRealm.getClassLoader());
  | 

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4235661#4235661

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4235661




More information about the jboss-user mailing list