[ 
https://issues.apache.org/jira/browse/MNG-7479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17536986#comment-17536986
 ] 

ASF GitHub Bot commented on MNG-7479:
-------------------------------------

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

   > how do you expect filtering to happen to know which instance of EventSpy 
is expected in your Mojo instance?
   
   I don't have a mojo here, just o (project scoped) extension, according to 
the code I won't expect *thousands* but one instance per session?
   
   > Perhaps this study about LifecycleParticipant could help you
   
   Not really, just in case I accesses the Session and the Execution request, 
but calling:
   
   ```
   MavenExecutionRequest request = mavenSession.getRequest();
   EventSpyDispatcher dispatcher = request.getEventSpyDispatcher();
   ```
   
   results in ClassNotFoundException: 
org.apache.maven.eventspy.internal.EventSpyDispatcher... so no luck here.
   
   
   
   




> Export the package org.apache.maven.eventspy
> --------------------------------------------
>
>                 Key: MNG-7479
>                 URL: https://issues.apache.org/jira/browse/MNG-7479
>             Project: Maven
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 3.8.5
>            Reporter: Christoph Läubrich
>            Priority: Major
>
> I'm currently try to fetch a specific EventSpy to inject an event there 
> (maven-profiler).
> Sadly in my maven plugin when I try to get it injected:
>  @Requirement(role = EventSpy.class, hint = "profiler", optional = true)
>  EventSpy eventSpy;
> This results in ClassNotFoundException: org.apache.maven.eventspy.EventSpy
> I noticed that the maven-core do not export the 'org.apache.maven.eventspy' 
> package and that is the cause of this, I'd like to suggest to export the 
> package as there seem no other standard way to interact/access event spys 
> otherwise.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to