[3.9.x] [MNG-7401] [MNG-7474] Keep a single maven session and fix session scope#743
[3.9.x] [MNG-7401] [MNG-7474] Keep a single maven session and fix session scope#743gnodet merged 2 commits intoapache:maven-3.9.xfrom
Conversation
|
Not sure why tests aren't running. I'll close this one and recreate a new PR. |
Ah, closing and reopening did the trick. |
|
We have TLS-based solutions in past releases and we had to revert. What makes this one different? |
It's not a new TLS, it's a move of the existing TLS from SessionScope to MavenSession. So there are several solutions to this problem, but I think the SessionScope is useless in the current form. So if we don't want to use a single session and keep things the way they are, I'd need to introduce a more global scope with a real singleton session object. We can't simply change the SessionScope, because beans are injected with the MavenSession, so if we want singletons, we need to have a consistent MavenSession object across mojo executions, which is not the case because of the multiple session clones.
I think the cleaner state would be to fix the |
I think this is (at least for the Tycho scope of the problem) the most noteable thing, and we use The problem with the cloning is, that if I have a sessionscoped componet I get the "rootsession" and thus calling |
I think the problem is that we then need some kind of "ProjectScope", I think |
|
Is there a reasonable IT for this? |
Now that the Session is not cloned anymore, we can revert to the original (Maven < 3.3) behavior of the session scoped components. Co-authored-by: Christoph Läubrich <christoph@laeubi-soft.de> This closes apache#743
michael-o
left a comment
There was a problem hiding this comment.
LGTM, let's go over to the IT now.
…pe (#743) * [MNG-7474] SessionScoped beans should be singletons for a given session Now that the Session is not cloned anymore, we can revert to the original (Maven < 3.3) behavior of the session scoped components. Co-authored-by: Christoph Läubrich <christoph@laeubi-soft.de> This closes #743 * Remove setting a value which is the default already Co-authored-by: Christoph Läubrich <christoph@laeubi-soft.de> # Conflicts: # maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java # maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScope.java
|
Resolve #9168 |
https://issues.apache.org/jira/browse/MNG-7401
https://issues.apache.org/jira/browse/MNG-7474
@laeubi this supersedes #666