Skip to content

docs(building): say what to do about "Could not build dependency tree" - #2040

Merged
jcschaff merged 1 commit into
masterfrom
docs/enforcer-dependency-tree-tip
Aug 30, 2026
Merged

docs(building): say what to do about "Could not build dependency tree"#2040
jcschaff merged 1 commit into
masterfrom
docs/enforcer-dependency-tree-tip

Conversation

@jcschaff

Copy link
Copy Markdown
Member

Item (1) of #2038 — the cheap 90%.

Adds a section to docs/BUILDING.md telling you to re-run with -X and grep for Caused by when the enforcer reports:

[ERROR] Rule 0: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message:
Could not build dependency tree Could not collect dependencies: org.vcell:vcell-rest:jar:1.0.0-SNAPSHOT

The rule discards the underlying ArtifactResolutionException, so that message names the module the rule was bound to and nothing else — not the artifact that failed, not the repository that failed to serve it.

The section covers three things:

  • the command, with the real -X output from run 33104159035 as the worked example
  • why the log misdirects — the rule fires on whichever module is checked first, so it reads as "vcell-rest is broken" when the condition is repository-wide; and any other resolution message becomes the only concrete detail available, which makes it look like the cause. That is exactly what happened: the visible hint was a net.minidev:json-smart warning, and the first attempted fix went after json-smart. The real failure was org.jboss.narayana.jts:idlj-idl-openjdk, via quarkus-agroal -> quarkus-narayana-jta.
  • the 404-vs-503 asymmetry — Maven reads a 404 as "ask the next repository" and a 503 as a hard error, which is how an artifact that exists in no repository at all can break a build that never needed it.

Written to match the voice of the existing "Why Python first" section, which has the same shape: name the misleading symptom, then say what to actually do.

Documents the workaround only. #2038 items (2) and (3) — whether a newer enforcer than our pinned 3.1.0 propagates the cause, and running dependency:tree ahead of enforce in CI — are still open, and (2) would make this section unnecessary.

Docs only; no build files touched. Independent of #2037 and mergeable in either order.

🤖 Generated with Claude Code

https://claude.ai/code/session_01D71LBYmQNf5J94wPqr81Jx

The enforcer's DependencyConvergence rule discards the underlying
ArtifactResolutionException and reports only that the tree could not be
built, naming the module the rule was bound to and nothing else. The
artifact that failed and the repository that failed to serve it are both
in the -X output, and nowhere else.

Two things make that worse than an ordinary unhelpful error. The rule
fires on whichever module is checked first, so the log reads as "vcell-rest
is broken" when the condition is repository-wide. And any other resolution
message in the log is then the only concrete detail available, which makes
it look like the cause when it may not be - in run 33104159035 the only
visible hint was a warning about net.minidev:json-smart, and the first
attempted fix went after json-smart. The actual failure was an artifact on
a dependency path nobody would have guessed.

Also records the 404-vs-503 asymmetry, since it is what makes an artifact
that exists in no repository at all break a build that never needed it.

Documents the workaround only; see #2038 for whether a newer enforcer
propagates the cause, which would make this section unnecessary.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D71LBYmQNf5J94wPqr81Jx
@jcschaff
jcschaff merged commit f0bb594 into master Aug 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant