docs: rewrite how-resolver-works.md to STE rules - #2046
Conversation
|
CI seems borked: |
gnodet
left a comment
There was a problem hiding this comment.
The prose improvements are welcome, but there are several factual accuracy issues that need fixing before this can be merged:
resolveArtifactsdescription is wrong — it does not build a flattened list; flattening is done bydoFlattenDependencyNodesinsideresolveDependencies- TODO left in published docs — "TODO: do they give the same result?" on line 119
- Grammar error — "also be resolved" missing "can" on line 68
- "binary resource" is inaccurate — POMs are text/XML; the
ArtifactJavadoc says "identifying coordinates and optionally a file" - Dirty graph omits cycles —
CollectResultexplicitly tracksList<DependencyCycle> <aside>HTML tag — not used anywhere else in site markdown, rendering risk with Doxia
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
| * Method `DependencyResult resolveDependencies(RepositorySystemSession session, DependencyRequest request)` performs both | ||
| collection and resolution steps. | ||
| * `CollectResult collectDependencies(RepositorySystemSession session, CollectRequest request)` performs the dependency collection step. It builds the dependency graph and resolves conflicts in that graph before returning. | ||
| * `List<ArtifactResult> resolveArtifacts(RepositorySystemSession session, Collection<? extends ArtifactRequest> requests)` performs the artifact resolution step. It builds a flattened list and downloads artifacts before returning. |
There was a problem hiding this comment.
This description is factually incorrect. resolveArtifacts takes a pre-supplied Collection<? extends ArtifactRequest> and resolves their paths — it does not build a flattened list. DefaultRepositorySystem.resolveArtifacts (lines 308-334) delegates directly to artifactResolver.resolveArtifacts(session, requests). Flattening is done only inside resolveDependencies via doFlattenDependencyNodes (line 421-422).
Suggested:
| * `List<ArtifactResult> resolveArtifacts(RepositorySystemSession session, Collection<? extends ArtifactRequest> requests)` performs the artifact resolution step. It builds a flattened list and downloads artifacts before returning. | |
| * `List<ArtifactResult> resolveArtifacts(RepositorySystemSession session, Collection<? extends ArtifactRequest> requests)` performs only the artifact resolution step. It resolves the paths for a collection of artifacts, downloading them from remote repositories if necessary. |
There was a problem hiding this comment.
Notice above where it says, "Resolver also usually resolves artifacts as it builds the flattened list.
The name for this combined step is artifact resolution." Is this also wrong? (it might be.) This was originally "The "flattening" and "artifact resolving" are also usually done together, and we use for those the term "artifact resolution"."
| Resolver 2.x has two conflict resolution implementations. | ||
| The legacy implementation does multiple graph passes. | ||
| The faster path-based implementation does a single graph pass. | ||
| TODO: do they give the same result? |
There was a problem hiding this comment.
This TODO should not appear in published documentation. Either answer the question and replace with a factual statement, or remove it.
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
gnodet
left a comment
There was a problem hiding this comment.
Thanks for fixing the grammar error and adding cycles to the dirty graph description. Four issues from the previous review remain:
- TODO in published docs (line 119) — still present
resolveArtifactsdescription (line 148) — still says "builds a flattened list"; it takes a pre-suppliedCollectionand resolves paths, no flattening- "binary resource" (line 34) — POMs are text/XML, not binary
<aside>tag (line 67) — not used elsewhere in site markdown
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
gnodet
left a comment
There was a problem hiding this comment.
Thanks for removing the TODO. Three issues remain from previous reviews:
resolveArtifactsdescription — still says "builds a flattened list"; it takes a pre-suppliedCollectionand resolves each artifact in it- "binary resource" — POMs are text/XML artifacts, not binary; suggest dropping "binary"
<aside>tag — not used elsewhere in site markdown; a blockquote (> ...) would be safer for Doxia rendering
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
gnodet
left a comment
There was a problem hiding this comment.
The STE rewrite improves prose quality throughout. Several factual inaccuracies remain — see inline comments.
Additional notes:
- "you can collect the dirty graph for inspection and skip conflict resolution" (line 169) contradicts the earlier statement that
collectDependencies"resolves conflicts in that graph before returning" (line 160). To get the unresolved graph, you would need to configure a nullDependencyGraphTransformer— this is not explained. - "Resolver also usually resolves artifacts as it builds the flattened list" (line 149) implies interleaving, but in
DefaultRepositorySystem.resolveDependencies(), flattening completes first (doFlattenDependencyNodesat line 422), then artifact resolution runs on the result (line 438). They are sequential steps.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
| * Method `DependencyResult resolveDependencies(RepositorySystemSession session, DependencyRequest request)` performs both | ||
| collection and resolution steps. | ||
| * `CollectResult collectDependencies(RepositorySystemSession session, CollectRequest request)` performs the dependency collection step. It builds the dependency graph and resolves conflicts in that graph before returning. | ||
| * `List<ArtifactResult> resolveArtifacts(RepositorySystemSession session, Collection<? extends ArtifactRequest> requests)` performs the artifact resolution step. It builds a flattened list and downloads artifacts before returning. |
There was a problem hiding this comment.
resolveArtifacts does not build a flattened list. Its signature takes a pre-supplied Collection<? extends ArtifactRequest> and resolves the path for each artifact in that collection. Flattening is done by doFlattenDependencyNodes inside resolveDependencies, not resolveArtifacts. The Javadoc says: "Resolves the paths for a collection of artifacts."
This has been flagged in previous reviews.
| * `List<ArtifactResult> resolveArtifacts(RepositorySystemSession session, Collection<? extends ArtifactRequest> requests)` performs the artifact resolution step. It builds a flattened list and downloads artifacts before returning. | |
| * `List<ArtifactResult> resolveArtifacts(RepositorySystemSession session, Collection<? extends ArtifactRequest> requests)` performs the artifact resolution step. It resolves the path for each artifact in the provided collection, downloading from remote repositories if necessary. |
There was a problem hiding this comment.
Notice lines 148-149, or line 114 in the original. This might be wrong, it probably is, but it's not enough to just change it here. What else needs to be done?
| Furthermore, there are extension points like `WorkspaceReader` that can make artifacts resolvable | ||
| without installing or deploying them, but that is an integration detail (like Maven does by exposing reactor projects). | ||
| **Artifacts** and **repositories** are at the core of Resolver. | ||
| An *artifact* is a binary resource with Maven coordinates. |
There was a problem hiding this comment.
"binary resource" is inaccurate — POM files are text/XML artifacts. The Artifact Javadoc says: "an artifact has identifying coordinates and optionally a file that denotes its data." Dropping "binary" would fix this.
| An *artifact* is a binary resource with Maven coordinates. | |
| An *artifact* is a resource identified by Maven coordinates. |
There was a problem hiding this comment.
It is a binary resource. Maven loads it as bytes without processing or decoding text.
| To make an artifact resolvable from the local repository, you install it. | ||
| To make an artifact resolvable from a remote repository, you deploy it. | ||
|
|
||
| <aside> |
There was a problem hiding this comment.
The <aside> HTML tag is not used anywhere else in the project's site markdown. Doxia (Maven's site renderer) may not render it properly. A standard markdown blockquote would be safer and more consistent.
There was a problem hiding this comment.
This is not a block quote. It is an aside. We may not use this particular tag yet, but I think we do use pass-through HTML and Doxia does support it.
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
gnodet
left a comment
There was a problem hiding this comment.
Re-review (2nd pass): Thank you for addressing the "resolving" definition (now correctly says "storing it locally"). One high-severity factual issue remains from the previous review, plus a minor rendering note.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
| * Method `DependencyResult resolveDependencies(RepositorySystemSession session, DependencyRequest request)` performs both | ||
| collection and resolution steps. | ||
| * `CollectResult collectDependencies(RepositorySystemSession session, CollectRequest request)` performs the dependency collection step. It builds the dependency graph and resolves conflicts in that graph before returning. | ||
| * `List<ArtifactResult> resolveArtifacts(RepositorySystemSession session, Collection<ArtifactRequest> requests)` performs the artifact resolution step. It builds a flattened list and downloads artifacts before returning. |
There was a problem hiding this comment.
This description is still inaccurate. resolveArtifacts does NOT build a flattened list — it takes a pre-supplied Collection<? extends ArtifactRequest> and resolves the path for each artifact, downloading from remote repositories if necessary.
The source code at DefaultRepositorySystem.java:308-334 confirms: resolveArtifacts simply validates requests and delegates to artifactResolver.resolveArtifacts(session, requests). Flattening is performed by doFlattenDependencyNodes inside resolveDependencies (a different method).
The Javadoc says: "Resolves the paths for a collection of artifacts."
Suggested fix:
| * `List<ArtifactResult> resolveArtifacts(RepositorySystemSession session, Collection<ArtifactRequest> requests)` performs the artifact resolution step. It builds a flattened list and downloads artifacts before returning. | |
| * `List<ArtifactResult> resolveArtifacts(RepositorySystemSession session, Collection<ArtifactRequest> requests)` performs the artifact resolution step. It resolves the path for each artifact in the provided collection, downloading from remote repositories if necessary. |
| To make an artifact resolvable from the local repository, you install it. | ||
| To make an artifact resolvable from a remote repository, you deploy it. | ||
|
|
||
| <aside> |
There was a problem hiding this comment.
Minor: <aside> is not used in any other Markdown file in the project's site. The Maven site skin likely has no CSS styling for it, so it would render identically to surrounding text with no visual distinction. A blockquote (> ...) would be safer and consistent with the rest of the docs.
elharo
left a comment
There was a problem hiding this comment.
Is there a way to stop Claude from reviewing this? At this point it is just repeating itself and not responsive to comments. Human review and discussion on the remaining points is needed.
Along with the usual style improvements: