-
Notifications
You must be signed in to change notification settings - Fork 31
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
Maven Workspace Reader 'findArtifact' should not return cached Maven projects (?) #454
Comments
The MavenProjectCache is pretty useful when working on a single file. It prevents from having to rebuild the model all the time according to the content of the working copy. Overall, the projectCache should probably be internal, and renamed to something like "projectsWorkingCopy" and only contain the project that are being edited; and for other cases, the workspaceReader should be queried. |
In reality projectCache, f.i. for Tychio project added to Workspace, contains >900 Maven Projects, and most of them have At the same workspaceReader contains all the Artifacts included to the Workspace which fully suits the |
The same thing happens for
|
…projects (?) eclipse-lemminx#454 This fixes the similar exception for 'MavenLemminxWorkspaceReader.findVersions' Fixes: eclipse-lemminx#454
The Maven Workspace Reader probably should not acquire and try returning Maven projects collected in Maven Projects Cache ...
First of all, the
MavenLemminxWorkspaceReader.findArtifact(Artifact)
method overridesorg.eclipse.aether.repository.WorkspaceReader.findArtifact(Artifact)
and aims to return an information on Workspace artifacts (projects), not all the dependency artifacts (collected in Maven Projects Cache).Secondly, Maven Resolver starts acquiring different sources on early stages, which sometimes causes a Concurrent Modification -like exceptions to appear when getting the list of projects collected in Maven Projects Cache (as the cache is actively building at stat up) see #449 and the following stacktrace, clearly showing a loop like "MavenProjectCache.parseAndCache -> .DefaultArtifactResolver.resolve -> MavenLemminxWorkspaceReader.findArtifact -> MavenProjectCache.getProjects` which causes a CME-like exceptions:
Also, by adding additional logging, I traced the results returning by
MavenLemminxWorkspaceReader.findArtifact
and this has shown that NOT A SINGLE non-null Maven project file was found from the Maven Projects Cache for my test workspace with Tycho project imported into it. Every non-null resulting Maven project file returned was representing an Artifact of the given Tycho project and was found by searching in Artifacts loaded n Maven Workspace Reader after the initialization. All the null-results were returned for the projects collected in Maven Projects Cache where most of the cached projects are not part of the Workspace.Giver all this I believe that the Maven Workspace Reader API methods should not try/acquire/read any Maven Project data from the Maven Projects Cache and any try to do that is erroneous and should be avoided.
The text was updated successfully, but these errors were encountered: