Repository navigation
Update bundled maven to 3.10.1 - #9642
Conversation
|
local repo scan metrics atm, scanning my current .m2 folder (~500 mb): ideally we should verify that NB 31 and rewrite produce the same results, but it appears to work on first glance. Thinking about printing the whole dep list while its indexing to sout and diff it - probably the quickest smoke test. |
cd93a94 to
751bc21
Compare
|
Some Maven-side notes, in case they help:
|
To add a little context, this is only needed so that the following call path doesn't fork more threads behind the scenes, since some hacks there use thread local storage for communication between method calls:
For the hack inside Everything else can remain multithreaded -> if it doesn't its also fine. Hopefully this can be all cleaned up at some point so that it is maintainable again. |
switched from edit: using |
|
paused until future maven 3.10 point release. We might be able to remove a workaround or two before integration. Since this targets now NB 33 there is no time pressure anymore. We could get refactorings like #9694 in first since those apply to all versions and can be tested independently. |
|
testing 3.10.1 snapshot with workarounds reverted looks good. all green. |
ships with resolver 2.x
- The indexer used to build a full MavenProject per artifact via the project embedder, pulling in deprecated org.apache.maven.artifact APIs. It now reads the artifact descriptor directly with Aether (RepositorySystemSupplier + readArtifactDescriptor) and indexes the direct dependencies from there, which is lighter and off the deprecated APIs. - Resolution is strictly local: the request carries no remote repositories, so artifacts whose pom is missing from the indexed local repository are skipped instead of fetched (the old offline project embedder behaved the same way). - The Aether session is created per repository indexing context and released again by NexusRepositoryIndexManager (the creator is now AutoCloseable); system properties come from the new EmbedderFactory.getStaticSystemProperties(), which needs no embedder instance. - The artifact's classifier is now passed along, which the old createArtifact() call dropped.
- Placeholder (forged) artifacts from ArtifactFixer implementations were collected via a thread-local set. When dependency collection runs on a pool of threads, the fixer is invoked on worker threads where the thread-local is not set, so the artifacts were silently lost. - The capture is now an explicit, thread-safe PlaceholderCapture passed down the call chain (MavenEmbedder.readProjectWithDependencies -> ArtifactFixer.resolve). - ArtifactFixer gains a default resolve(Artifact, PlaceholderCapture) overload delegating to resolve(Artifact), so existing implementations keep working unmodified.
|
switched to release build of 3.10.1 and squashed to 3 commits. Rest was already extracted and integrated via other PRs. |
|
would be a good time to merge this since the release is done. Hoped the mail thread would bring some eyes on it but i should have requested reviewers earlier i suppose. Planning to merge it tomorrow so that we can find problems easier if there are any + we can work on the followups like #9694. |
|
Eyeballed this and it survived minimal testing @home and in my work environment. |

draft until maven 3.10.1 is released + manual testing
split in 3 commits:
ArtifactDependencyIndexCreatorto stop usingMavenEmbedder(and plexus)todo:
MavenReloadImplementationTest#testUnresolvableArtifactAppearsfailureNbArtifactFixerassuming the thread doesn't change betweencollectPlaceholderArtifacts()andresolve()NbMavenProjectImplTest#testMavenConfigMavenSourceLevelImplTest#testSystemPropertySourceLevelMicronautPackagingArtifactImplTest#testProjectArtifactOptionalNativeAndActionArtifactDependencyIndexCreatorwithout embedder which would resolve this issue but requires regression testing Update bundled maven to 3.10.1 #9642 (comment) (bonus: migrates away from deprecated API)