You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Guillaume Nodet (Jira)" <ji...@apache.org> on 2022/10/20 08:11:03 UTC

[jira] [Updated] (MNG-7401) Make MavenSession#getCurrentProject() using a thread local

     [ https://issues.apache.org/jira/browse/MNG-7401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet updated MNG-7401:
---------------------------------
    Fix Version/s: 4.0.0-alpha-2

> Make MavenSession#getCurrentProject() using a thread local
> ----------------------------------------------------------
>
>                 Key: MNG-7401
>                 URL: https://issues.apache.org/jira/browse/MNG-7401
>             Project: Maven
>          Issue Type: Improvement
>            Reporter: Christoph Läubrich
>            Assignee: Guillaume Nodet
>            Priority: Major
>             Fix For: 3.9.0, 4.0.0-alpha-1, 4.0.0-alpha-2, 4.0.0
>
>
> I noticed that a session is often cloned due to change the current project for a while.
> As this works for everyone passing down the session, consumers of the "upper session" (e.g. a SessionScoped Component) would never see this if they are (indirectly) called and e.g. use Session#getCurrentProject().
> I wonder if MavenSession could simply use a ThreadLocal for the currentProject (that is shared accross all cloned sessions), that way one would always get the correct value.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)