Repository navigation
fix(manifest): keep unresolved JVM dependencies from looking resolved - #1642
Closed
Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 5 commits into
Closed
Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 5 commits into
Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 5 commits into
Conversation
Reachability reads a sidecar component without targets as not installed and `targets: []` as resolved with no artifact. Several producer paths blurred the two, so failed dependencies looked healthy or code-less: - Maven: a collection failure no longer strips every jar of the module; missing or invalid POMs, cached descriptor failures in later modules and system-scope jars are reported; failures get the scope Maven would have given them. - Gradle: verification failures, failed project dependencies and artifacts that cannot be listed are reported; failures name the attempted version. - sbt: a jar coursier skips or Ivy fails to download is reported under its full coordinate, while pom-packaged and non-jar modules keep their real shape. - Assembler: an artifact with any unfetched or missing file has no targets; an excluded module keeps its paths for the projects depending on it; a crashed sbt root no longer reuses another root's records. - Reports: ambiguity blocks only when the module resolved nowhere, and reachability remedies name --reach-continue-on-install-errors. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- sbt: an artifact failure that alone fails sbt's update is reported without files too; the Ivy report search stays inside the project's target. - Gradle: verification is checked only for builds with verification metadata, a failure of another artifact of the same module no longer drops this configuration's jar, and an unrelated artifact-view error no longer discards a walked configuration; folding artifactless nodes is linear. - Maven: a direct test-jar dependency matches its declared scope, and a POM a strict descriptor policy rejects is reported once. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ring Share the repeated failure reporting, XML parsing and descriptor matching in the producers; build expensive state (lenient sbt state, scope maps, resolved modules, the Gradle unresolved-dependency walk) only when something failed; keep excluded projects out of the parsed project list; and key modules through one helper. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Maven 4 derives and manages transitive scopes differently from Maven 3, so a transitive failure missing from its graph is no longer given a Maven 3 scope; its position is unknown. - Gradle verification uses the root build's metadata, as included builds do, and matches failed artifacts by the name Gradle reports them under. - sbt treats an `ejb` module's artifact as a jar, as current coursier does, and no longer reads Ivy's "null" download details as a reason. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member
|
Can you split this into reviewable pieces? |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLM Description written by Claude Code:claude-opus-5-5
Reachability reads a sidecar component with no
targetsas not installed, andtargets: []as resolved with no artifact. Several paths in the Maven, Gradle and sbt facts producers blurred the two, so a dependency that failed to resolve could reach Coana looking healthy or code-less, and its vulnerabilities could be reported unreachable.What changes
system-scope jars get their files. A failure gets the scope Maven would have given it, soexcludeConfigsand version-conflict losers no longer over-block. Maven 4 failures show their real cause.useCoursier := false.unfetchedrecord marks an artifact that could not be fetched, and any such or missing file leaves a component with notargets. A module excluded with--exclude-pathskeeps its paths (newexcludedProjectrecord), so the projects depending on it are analysed with its code. An sbt root that crashes before writing no longer reuses another root's records.--reach-continue-on-install-errors.Testing
Follow-ups (filed, not in this PR): REA-1005, REA-1006, REA-1007, REA-1008, REA-1009.
🤖 Generated with Claude Code
Note
Medium Risk
Changes core JVM SBOM/reachability fact assembly and failure handling across Maven, Gradle, and sbt; incorrect edge-case behavior could still affect scan completeness, but the intent is to fix false “resolved” states rather than broaden silent under-reporting.
Overview
Fixes JVM manifest/reachability paths where unresolved or unfetchable dependencies could look fully resolved, which made vulnerability reachability wrong or silent.
Facts producers (Maven, Gradle, sbt) now report more failure modes (missing/invalid POMs, verification failures, failed project deps, artifacts that never downloaded) and emit
unfetchedrecords so the assembler omitstargetsinstead of implying a healthy jar. Maven adds repository-event observation and can still materialize jars for healthy nodes when collection partially fails. Gradle reports the version actually attempted and treats strict dependency verification as failure. sbt distinguishes coursier “expected but missing” jars from true POM-only modules and surfaces Ivy download failures.Assembler & sidecar: partial or missing files drop
targets;excludedProjectkeeps source/classpath paths for--exclude-pathsmodules so dependents still analyze their code. Resolution reports useresolvedModulesso Gradle variant ambiguity only stays non-blocking when the module resolved elsewhere; reachability hints mention--reach-continue-on-install-errorswithignoreUnresolved. Auto-manifest aborts on facts generatornulloutcomes, not onlyprocess.exitCode. sbt clears sharedrecords.tsvbefore each root so a crashed build cannot reuse another root’s output.Extensive compat smoke tests and unit tests cover the new behavior across tool versions.
Reviewed by Cursor Bugbot for commit 0463ffd. Configure here.