The idea is to handle artifact version conflicts the same way we handle duplicate removal. In addition we consider two nodes are equal if the artifactId and the groupdId.webpackageName values are equal.
The algortihm for removal is as follows:
Traverse the dependencyTree in breadth first order and check for multiple occurances of the same artifact. This traversal order ensures a shortestPath lookup for selecting a node in the context of removing duplicates.
If there are multiple nodes considers equal (see above) we just use the first occurance of that node and remove all other occurances of that node.
Note: To keep information about the parent-child relationship for removed nodes the usesExisting and usedBy properties need to be set correctly!
As a result duplicates and artifact version conflicts are removed.
Tasks:
[x] remove methods
determineArtifactConflicts()
_extractVersionConflictsFromMixedConflict()
getListofConflictedNodes() and it's internal used method
determineTypeOfConflict()
[x] extend removeDuplicate() method (see comments in method body)
[x] add checkForConflicts() method
[x] the resolved DependencyTree instance should hold an internal list of all resolved conflicts ordered by type (nameConflictsand versionConflicts)
[x] adjust _logDependencyConflicts() in DependencyMgr class
The idea is to handle artifact version conflicts the same way we handle duplicate removal. In addition we consider two nodes are equal if the
artifactId
and thegroupdId.webpackageName
values are equal.The algortihm for removal is as follows:
shortestPath
lookup for selecting a node in the context of removing duplicates.equal
(see above) we just use the first occurance of that node and remove all other occurances of that node. Note: To keep information about the parent-child relationship for removed nodes theusesExisting
andusedBy
properties need to be set correctly!Tasks:
determineArtifactConflicts()
_extractVersionConflictsFromMixedConflict()
getListofConflictedNodes()
and it's internal used methoddetermineTypeOfConflict()
removeDuplicate()
method (see comments in method body)checkForConflicts()
methodDependencyTree
instance should hold an internal list of all resolved conflicts ordered by type (nameConflicts
andversionConflicts
)_logDependencyConflicts()
inDependencyMgr
class