Skip to content

docs: rewrite how-resolver-works.md to STE rules - #2046

Open
elharo wants to merge 13 commits into
masterfrom
docs/ste-how-resolver-works
Open

docs: rewrite how-resolver-works.md to STE rules#2046
elharo wants to merge 13 commits into
masterfrom
docs/ste-how-resolver-works

Conversation

@elharo

@elharo elharo commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Along with the usual style improvements:

  • Much more precise and careful definitions of terms. The previous definition of artifact was simply wrong.

@elharo elharo added the documentation Improvements or additions to documentation label Aug 8, 2026
@elharo

elharo commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

CI seems borked:

[13](https://github.com/apache/maven-resolver/actions/runs/31255258160/job/93097599126?pr=2046#step:12:914)
Error: [ERROR] /Users/runner/work/maven-resolver/maven-resolver/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositorySystemReentrancyTest.java:[361,17] incompatible types: no instance(s) of type variable(s) T exist so that java.util.List<T> conforms to java.util.Map<java.lang.String,org.eclipse.aether.spi.validator.ValidatorFactory>
Error: [ERROR] /Users/runner/work/maven-resolver/maven-resolver/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositorySystemReentrancyTest.java:[398,17] incompatible types: no instance(s) of type variable(s) T exist so that java.util.List<T> conforms to java.util.Map<java.lang.String,org.eclipse.aether.spi.validator.ValidatorFactory>
Error: [ERROR] /Users/runner/work/maven-resolver/maven-resolver/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositorySystemReentrancyTest.java:[457,17] incompatible types: no instance(s) of type variable(s) T exist so that java.util.List<T> conforms to java.util.Map<java.lang.String,org.eclipse.aether.spi.validator.ValidatorFactory>
[INFO] 3 errors

@elharo
elharo marked this pull request as ready for review August 8, 2026 13:03
@elharo
elharo requested a review from cstamas August 8, 2026 13:03

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prose improvements are welcome, but there are several factual accuracy issues that need fixing before this can be merged:

  1. resolveArtifacts description is wrong — it does not build a flattened list; flattening is done by doFlattenDependencyNodes inside resolveDependencies
  2. TODO left in published docs — "TODO: do they give the same result?" on line 119
  3. Grammar error — "also be resolved" missing "can" on line 68
  4. "binary resource" is inaccurate — POMs are text/XML; the Artifact Javadoc says "identifying coordinates and optionally a file"
  5. Dirty graph omits cyclesCollectResult explicitly tracks List<DependencyCycle>
  6. <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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
* `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.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TODO should not appear in published documentation. Either answer the question and replace with a factual statement, or remove it.

Comment thread src/site/markdown/how-resolver-works.md Outdated
Comment thread src/site/markdown/how-resolver-works.md
Comment thread src/site/markdown/how-resolver-works.md Outdated
elharo and others added 2 commits August 8, 2026 10:29
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the grammar error and adding cycles to the dirty graph description. Four issues from the previous review remain:

  1. TODO in published docs (line 119) — still present
  2. resolveArtifacts description (line 148) — still says "builds a flattened list"; it takes a pre-supplied Collection and resolves paths, no flattening
  3. "binary resource" (line 34) — POMs are text/XML, not binary
  4. <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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants