List edgesFrom = graph.getEdgesFrom( node );
Iterator it = edgesFrom.iterator();
while ( it.hasNext() )
{
DependencyGraphEdge edge = (DependencyGraphEdge) it.next();
Rules rules = depStack.getRules( edge );
if ( rules == null )
{
// No rules for edge, skip it.
continue;
}
DependencyGraphNode subnode = graph.getNode( edge.getNodeTo() );
/* There are 3 steps to processing the DependencyManagement. */
/* 1) Add exclusions to node ________________________________________________ */
node.getExcludes().addAll( rules.exclusions );
/* 2) Track version changes to node _________________________________________ */
// This is the version as specified by the rules.
String specifiedVersion = rules.artifact.getVersion();
// This is the version as being tracked by the nodeVersionChanges map.
String trackedVersion = (String) nodeVersionChanges.get( edge.getNodeTo() );
// This is the version of the subnode.
String nodeVersion = subnode.getArtifact().getVersion();
// This is the actual version as determined by tracked and subnode
String actualVersion = StringUtils.defaultString( trackedVersion, nodeVersion );
// If the specified version changes the actual version ...
if ( !StringUtils.equals( specifiedVersion, actualVersion ) )
{
// ... save this new value to be track ( for processing in #finishedGraph )
nodeVersionChanges.put( edge.getNodeTo(), specifiedVersion );
}
/* 3) Update scope to edge __________________________________________________ */
if ( StringUtils.isNotBlank( rules.scope ) )
{
edge.setScope( rules.scope );
}
}
}