Repository navigation
Just get a classloader for the Mojo, no need for an actual instance - #140
Conversation
@fbricon @mickaelistria perhaps you have any input into how (and whether) this can be avoided? |
|
Would |
|
no, there is no instance of the Mojo (that's the whole point) |
29171cd to
f5c68b1
Compare
|
The "only" internal API needed is |
|
I think you should first refine "in big workspaces we noticed strange classloading errors in Eclipse" with something reproducible to narrow down the root cause. What you're suggesting seems more like a workaround IMO, and the real bug is that mojo instantation to screw up resource loading. |
|
In an ideal world you might be right. But: As I wrote, the problem is not reproducible, but a huge PITA. We get it mostly during startup in large workspaces. It might be a bug in m2e or in the way the Mojo was instantiated here, but in the end the instance is not even needed here at all. Honestly, turning to and waiting on m2e is no option: first of all, that would only work with they most recent version then. Also, our experience with getting someting into m2e is, eh, let's say "not ideal" (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=486737, which will soon have it's 3rd anniversary). Other m2e plugins are using Also, I see no option to "duplicate code" here, as there is no other way to access the PlexusContainer that I can see. |
|
I don't want to get in the middle of something where there may be some prior history 😸 but perhaps @erwint if you could at least open a new issue on M2E, and perhaps even raise a Gerrit there, with a proposal how to expose what API you would need to do this here "properly" to further discuss with @mickaelistria, more for the medium term, then perhaps for the short term this could already be merged here anyway? |
|
I added https://bugs.eclipse.org/bugs/show_bug.cgi?id=539248 for m2e to provide an API |
|
A gerrit change for m2e is now also provided: https://git.eclipse.org/r/#/c/129717/ |
|
Change in m2e has been merged, but will be available with 1.10 only. I suggest merging this PR and as soon as we require 1.10 (might be some while) to update it to the API in |
|
Agreed, and will do as soon as I'm not on mobile, walking around an
airport. - Or I really need to login to GitHub on this Mobile account so
that I can do it next time! ;)
|
In big workspaces we noticed strange classloading errors in Eclipse, which result from Mojo instantiated for the ResourceResolver. As the Mojo instance is not needed at all (just it's classpath), we changed it to not actually create instances of the Mojo. Unfortunately, some internal m2e API is needed for this.