Hi Christoph,

There is no real doc but a few things make it hard:

1. Plugin expect the injected session to stay so threadlocal dont work in
general and inheritedthreadlocal leak being an issue in several env like
mvnd
2. It should support concurrency

There was some hack done but if you still hit some issue i guess a kind of
view injection will be needed per mojo instead of hacking the session
itself directly ensuring the session is thread safe but the mojo also stick
to its view/project instance.

Le sam. 29 janv. 2022 à 11:35, Christoph Läubrich <[email protected]> a
écrit :

> I'm currently having some issues in a plugin that access the
> MavenSession with different threads.
>
> I can't find that MavenSession is intended for concurrent access so I
> wonder if in general it should support that case or if it is expected to
> clone the session?
>
> But clone() does not make a deep copy so there are still room for
> problems (e.g. modifications might not write through to the original
> session) so I wonder if there is any normative document telling how to
> handle a session correctly?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to