-
Notifications
You must be signed in to change notification settings - Fork 868
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
#6525: maven execution should setup LegacySupport before running Maven #6552
Conversation
unfortunately this doesn't solve the issue for me. I am getting the same exception still, following the same steps from the issue. (I use the arrow keys to jump from diff to diff, I could reproduce this twice in a row with fresh config) |
Heh ... good, I'll give it more rounds of testing. Could you possibly test a diagnostic maven patch ? Someone is creating RepositorySession inside maven... |
sure, no problem |
Hm. So not only unconfigured session. Maven's The new commit in this patch replaces the current value with the appropriate one, configured for the executing Embedder; this does not affect other threads (if they use also Maven libraries), as it is replaced in a thread-local variable. @mbien -- Please test from this PR's branch. There's a Maven patch attached, against |
ran a quick test and it appears to be working now (no exceptions), it produces a LOT of log output, so i hope that doesn't influence the timing. have no time atm for more, but can test again this evening or tomorrow. |
93fded8
to
dc0615f
Compare
Do not process the log, my bad - I had one more staged change on my local :( sorry ... replaced the last commit. I set up a value in System properties and check it inside maven libs to ensure that the repository session is 'correct'; the actual fix was already there, but the additional check was broken :) If you can, try the updated branch in the next time slot -- thanks for your time. |
log is now clean without thread dumps or exceptions |
@sdedic if this is ready to merge, please squash / clean up (remove println) so that we can get this in before freeze. |
dc0615f
to
1aabe20
Compare
Cleaned up |
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.
thanks @sdedic!
During debugging of #6525, it turned out that during the project read, the execution sometimes avoided the call to
setupLegacySupport
in our MavenEmebdder before invoking Maven - and when the execution finally reached e.g.NbRepositoryModelResolver.resolveModel
, the LegacySupport was already set up by maven core - and by default for online operation.Futher calls to
setupLegacySupport
detected an existing session (from Maven) and did not create a NB-compatible setup.The PR just ensures the LegacySupport is set up prior to maven call, so it is consistent with NB needs.