You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/05/19 13:24:14 UTC

[GitHub] [maven] laeubi commented on pull request #743: [3.9.x] [MNG-7401] [MNG-7474] Keep a single maven session and fix session scope

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

   > revert the use of multiple sessions, i.e. use a single session throughout the whole build, which is what this PR is about.  The possible drawback is breakages of code that would use `MavenSession.getCurrentProject()` from a different thread
   
   I think this is (at least for the Tycho scope of the problem) the most noteable thing, and we use `LegacySupport` what effectivly *is* a Threadlocal, so from what I can tell, in almost all cases `MavenSession.getCurrentProject()` returning the current project "of the thread" would be sufficient and cloning the session seem to be effectively for that purpose.
   
   The problem with the cloning is, that if I have a sessionscoped componet I get the "rootsession" and thus calling `MavenSession.getCurrentProject()` most of the time returns `null` as the actual project is set on a cloned copy.
   


-- 
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-unsubscribe@maven.apache.org

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