-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.9.x] [MNG-7401] [MNG-7474] Keep a single maven session and fix session scope #743
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? |
maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilderTest.java
Show resolved
Hide resolved
maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilderTest.java
Outdated
Show resolved
Hide resolved
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
https://issues.apache.org/jira/browse/MNG-7401
https://issues.apache.org/jira/browse/MNG-7474
@laeubi this supersedes #666