elharo opened a new pull request, #1652:
URL: https://github.com/apache/maven-dependency-plugin/pull/1652

   ## Summary
   
   `dependency:analyze -Dverbose` prints every dependency in **both** the 
warning section and the "Ignored" section when no `ignoredDependencies` are 
configured.
   
   ## Root cause
   
   `filterDependencies()` returns the full input `artifacts` set when 
`excludes` is null or empty (line 563). The method is meant to return the 
artifacts that were excluded (matched an exclude pattern). When no patterns are 
given, nothing was excluded, so it should return an empty set. Returning the 
full set instead tells all 8 callers that "everything was excluded," filling 
the ignored sections with duplicates.
   
   ## Fix
   
   One-line change in `AbstractAnalyzeMojo.java:563`:
   
   ```java
   return new LinkedHashSet<>();
   ```
   
   instead of:
   
   ```java
   return artifacts;
   ```
   
   ## Integration test
   
   Added `mdep-1645-verbose-no-duplicate-ignored` IT that:
   - Declares `commons-text`, uses `commons-lang3` (transitive)
   - Runs `dependency:analyze -Dverbose` with no `ignoredDependencies`
   - Asserts the warning sections appear but the ignored sections do not
   
   The test fails at HEAD and passes with the fix.
   
   ## PR contains:
   - [x] bug fix
   - [x] integration test (fails on unpatched code)
   - [x] no new unit test (the fix is a one-line change with no new logic)


-- 
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]

Reply via email to