slachiewicz opened a new issue, #342:
URL: https://github.com/apache/maven-dependency-analyzer/issues/342

   `ProjectDependencyAnalysis.forceDeclaredDependenciesUsage` rebuilds the used 
declared map with `mapWithKeys`, which puts an empty usage set on every 
artifact 
([ProjectDependencyAnalysis.java:363](https://github.com/apache/maven-dependency-analyzer/blob/master/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalysis.java#L363),
 
[`mapWithKeys`](https://github.com/apache/maven-dependency-analyzer/blob/master/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalysis.java#L492)).
 After a force, `getUsedDeclaredArtifactsWithUsages()` still returns the right 
artifacts, but none of them has any usages left, not only the forced ones. 
1.17.2 behaves the same.
   
   maven-dependency-plugin forces usage whenever `usedDependencies` matches an 
unused declared dependency, so anything that reads usages after that step sees 
nothing. The plugin works around it by reading the usages before forcing 
(apache/maven-dependency-plugin#1816).
   
   Expected: keep the existing usage sets, and add an empty set only for the 
newly forced artifacts.
   


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