slachiewicz commented on issue #280: URL: https://github.com/apache/maven-dependency-analyzer/issues/280#issuecomment-6773662676
## Triage/update on references - **#313 / PR #315 (merged, 1.17.3)** fixed the case where a *declared* artifact provides a used class but another artifact was credited first (now “declared wins over undeclared”; if two declared artifacts provide the same class only the first is credited). PR notes this is *complementary* to #280. - **Remaining gap (this issue):** when duplicates exist we still collapse to a single provider in `buildClassToArtifactMap` and `ProjectDependencyAnalysis` has no way to expose raw used types or all candidate artifacts/ambiguity. Shading (e.g. `webservices-api` vs Jakarta APIs) or undeclared/declared-duplicate cases where the “right” choice isn’t obvious remain opaque to `maven-dependency-plugin:analyze`. ## What’s proposed (see linked draft PR) Expose pre-mapping / ambiguity information without breaking existing behavior: 1. **Raw used types**: e.g. `ProjectDependencyAnalysis#getUsedClassNames()` (or include in a new view) collected before attribution. 2. **Candidates per class**: `getCandidateArtifacts(String className)` / `getAmbiguousUsedClasses()` returning all artifacts containing a referenced class. 3. **Usage-level ambiguity**: flag or attach candidate sets to `DependencyUsage`/report so plugins can suggest *all* possible declarations and/or mark the load-order winner. This keeps current single-artifact mapping as default (backward compatible) and adds opt-in data for richer reporting (and for agents/tools to act on ambiguity). Reproducer + ITs to follow in the PR. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
