-
Notifications
You must be signed in to change notification settings - Fork 304
Build system information should be optionally set #511
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
Build system information should be optionally set #511
Conversation
- Changes the build system information to be conditionally set within the properties. In multi-threaded builds, without the optional put, a ConcurrentModificationException occurs as this information is written at the same time the object is being iterated over.
@ryantse As far as I see If it was possible at all, it would be great if we could get the build server data only once and then share it with the invocations of the plugin in the Maven sub-modules. Otherwise making |
- Removes the usages of the underlying HashMap functions on Properties objects that lack synchronization and are not thread safe.
dea8c65
to
e0d9319
Compare
@joschi: Thanks for the quick feedback. You're right that the original patch didn't fully correct the thread-safety issue. The only time this really is a problem is when injectAllReactorProjects is turned on along with additional properties being configured in sub-modules. I have pushed another patch that more comprehensively addresses the issue. This patch removes all usage of the underlying HashMap functions in preference for equivalents in the Properties class. As Properties is properly synchronized, this mitigates all instances where multiple modules (and thus multiple threads) share the same object. |
@TheSnoozer: Could you take a look at this pull request as well? |
@TheSnoozer: Can this be merged or do you have any feedback on this patch? Thanks in advance! |
Hi, |
@TheSnoozer: I was able to test the snapshot build of the plugin with our build system and it works well in my environment. It would be great if you could release a 4.0.2 with these changes. |
Thanks for confirming! Will do a release on the weekend. |
Now available as https://repo1.maven.org/maven2/pl/project13/maven/git-commit-id-plugin/4.0.2/. Thanks again for the investigation and pushing for the solution! |
Changes the build system information to be conditionally set within the properties. In multi-threaded builds, without the optional put, a ConcurrentModificationException occurs as this information is written at the same time the object is being iterated over.
Context
Fixes #469.
Contributor Checklist
mvn clean package
checkstyle
coding style definition:mvn clean verify -Pcheckstyle -Dmaven.test.skip=true -B