-
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
[master][MNG-7156][MNG-7285] Add locking in MojoExecutor #627
Conversation
maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java
Outdated
Show resolved
Hide resolved
@@ -202,6 +210,80 @@ private void execute( MavenSession session, MojoExecution mojoExecution, Project | |||
} | |||
} | |||
|
|||
try ( ProjectLock lock = new ProjectLock( session, mojoDescriptor, aggregatorLock ) ) |
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.
This totally looks like SyncContext
in Resolver. @cstamas
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.
Yes, I think leveraging the AutoCloseable
makes sense here, but it's just a syntactic trick to avoid the finally block...
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.
A real example when things "click" into their place...
https://issues.apache.org/jira/browse/MNG-7156
https://issues.apache.org/jira/browse/MNG-7285
Hopefully supersedes #476, #578, #625 in order to fix the threading problems in
MavenProject
during parallel builds.This may need to be combined with #570 and apache/maven-integration-testing#127