What are you trying to do from a high level. Much of what Maven does to resolve, load and configure plugins dynamically can likely be reused, but if you tell me what you want I can point you at code you can lift. At a high level Maven:
1. Looks at some configuration and determines what the plugin is 2. Downloads the plugin into the local repository 3. Creates a class loader with the plugin artifact and its dependencies 4. Scans the class loader for component implementations (the mojos, and any ancillary components) 5. Instantiates the plugin 6. Applies configuration to the plugin 7. Executes the plugin On May 1, 2014, at 5:07 AM, Grzegorz Słowikowski <[email protected]> wrote: > Hi > > I need to read "implementation" value of a component with specified > "role" and "role-hint" > from "META-INF/plexus/components.xml" resource of dynamically resolved > artifact. > > In other words I want to do the same thing Maven does configuring mojo > attributes > with @Component( role = AnInterface.class hint = "foo") annotation. > Maven finds implementation in the classpath, initializes implementation > object > and assigns to mojo attribute. > > In my case I find and resolve an artifact containing the class > implementing "AnInterface.class" role > with "foo" hint (a have a well known pool of artifacts with different > implementations). > Now I need to get this implementation class name. > > How can I do this? > > Regards > Grzegorz Slowikowski > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > Thanks, Jason ---------------------------------------------------------- Jason van Zyl Founder, Apache Maven http://twitter.com/jvanzyl http://twitter.com/takari_io --------------------------------------------------------- I never make the mistake of arguing with people for whose opinions I have no respect. -- Edward Gibbon
