Consistently report conflict resolution This commit refactors how conflict resolution selection reasons are handled, in order to:
- collect the list of versions which participated in conflict resolution - report a single conflict resolution cause when conflicts are resolved several times for the same module - consistently report module replacement rules as rules, not conflict resolution. Before this change, a module replacement was reported as both a conflict and a rule
Fix NPE in capabilities conflict resolution It is possible that a large dependency graph resolves capabilities conflicts 2 by 2, at different "depth" in the transitive graph. In this case, it is possible for a module to be selected, but then it needs to be considered again when a new module providing the same capability appears in the graph. If not, we wouldn't choose any version, producing an NPE when we read the graph back from the binary store.
The error was discovered during dogfooding, so this commit is a pre-requisite to using capabilities in the Gradle build (will require a wrapper update).
This commit also improves the selection reason in case of capability conflict resolution, to make it clear it was upgraded to the latest version.