laeubi commented on PR #740:
URL: https://github.com/apache/maven/pull/740#issuecomment-1126642170

   By the way I can always inject me the container
   ```
   @Requirement
   PlexusContainer container;
   ```
   
   and then lookup the object by its (string) class name
   Object eventSpy;
   ```
   try {
       eventSpy = container.lookup("org.apache.maven.eventspy.EventSpy", 
"profiler");
       System.out.println("EventSpy is " + eventSpy);
   } catch (ComponentLookupException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
   }
   ```
   and then use reflection to call the `EventSpy#onEvent`, but this really 
makes the code quite ugly and only because I can't load the interface itself...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to