-
1. Re: [forge-users] ClassLoading - how to make every class (in the visited project) accessible ?
gastaldi Feb 25, 2015 11:22 AM (in response to alwad)1 of 1 people found this helpfulHi Jerome,
What do you mean by "P2 classpath"?
By all means, see if this addon helps you out:
http://forge.jboss.org/addon/me.gastaldi.forge:reflections
Best Regards,
George Gastaldi
On 02/25/2015 01:13 PM, forge-users@lists.jboss.org wrote:
Hello,
The context is using one's own addon in a second project. Say this addon manipulates all the @Path classes
As I was playing with code generation, I faced issues while trying to do Class.forName() because the addon has no knowledge of P2 classpath.
What I did is infer the file path of the sources and then use Roaster to get a JavaInterface.
But now, if I wanted to introspect (the java.lang.reflect way) a class declared in a dependency of this second project (like a class defined in twitter4j for example), how would I do ?
Should I loop on all JARs in the visited project then loop on all the JAR's .class entries and tell the classloader to load them ?
And same for target/classes ?
Or is it a special classloader that I haven't found ?
Cheers,
Jerome
Posted by forums
Original post: https://developer.jboss.org/message/920001#920001
_______________________________________________
forge-users mailing list
_______________________________________________
forge-users mailing list
https://lists.jboss.org/mailman/listinfo/forge-users
-
2. Re: ClassLoading - how to make every class (in the visited project) accessible ?
alwad Feb 27, 2015 4:34 AM (in response to gastaldi)Hello George,
By P2 I meant second project.
Context :
* 2 projects in the workspace, first is the addon, the second is where the addon is used, say a maven based webapp with jaxrs endpoints.
* My goal here is to generate SOAPUI xml out of the java interfaces that sport the JAXRS annotations
I used your addon in the simplistic way.
Definitely have to dig the question of scanners and do some tests to see if I can .
Cheers,
Jérôme