gnodet commented on PR #948:
URL: https://github.com/apache/maven/pull/948#issuecomment-1372252880

   Also, there is an existing workaround which I think I've used somewhere, but 
I can't recall where exactly.
   The idea is to define two beans:
   ```
   @Named
   @Singleton
   class MyLazyGraphBuilder implements GraphBuilder {
       @Inject
       private final PlexusContainer container;
       private GraphBuilder delegate() {
          return container.lookup(GraphBuilder.class, "myGraphBuilder");
       }
       Result<? extends ProjectDependencyGraph> build(MavenSession session) {
           return delegate().build(session);
       }
   }
   
   @Named("myGraphBuilder")
   @SessionScoped
   class MyGraphBuilder implements GraphBuilder {
       ...
   }
   ```
   
   I still think this should be done automatically, but not sure I'll have the 
time to dig much into sisu/guice...
   
   It may be preferable to use the workaround which will work on any maven 
version imho.


-- 
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