}
if ( model.getRelocation() != null )
{
// We need to CHANGE this node.
ArtifactReference refTO = new ArtifactReference();
refTO.setGroupId( fromNode.getArtifact().getGroupId() );
refTO.setArtifactId( fromNode.getArtifact().getArtifactId() );
refTO.setVersion( fromNode.getArtifact().getVersion() );
refTO.setClassifier( fromNode.getArtifact().getClassifier() );
refTO.setType( fromNode.getArtifact().getType() );
VersionedReference relocation = model.getRelocation();
if ( StringUtils.isNotBlank( relocation.getGroupId() ) )
{
refTO.setGroupId( relocation.getGroupId() );
}
if ( StringUtils.isNotBlank( relocation.getArtifactId() ) )
{
refTO.setArtifactId( relocation.getArtifactId() );
}
if ( StringUtils.isNotBlank( relocation.getVersion() ) )
{
refTO.setVersion( relocation.getVersion() );
}
DependencyGraphNode nodeTO = new DependencyGraphNode( refTO );
graph.addNode( nodeTO );
collapseNodes( graph, fromNode, nodeTO );
return;
}
boolean isRootNode = graph.getRootNode().equals( fromNode );
Iterator it;
if ( CollectionUtils.isNotEmpty( model.getDependencyManagement() ) )
{
it = model.getDependencyManagement().iterator();
while ( it.hasNext() )
{
Dependency dependency = (Dependency) it.next();
fromNode.addDependencyManagement( dependency );
}
}
if ( CollectionUtils.isNotEmpty( model.getDependencies() ) )
{
it = model.getDependencies().iterator();
while ( it.hasNext() )
{
Dependency dependency = (Dependency) it.next();
String scope = dependency.getScope();
// Test scopes *NOT* from root node can be skipped.
if ( DependencyScope.TEST.equals( scope ) && !isRootNode )
{
// skip add of test scope
continue;
}
ArtifactReference artifactRef = new ArtifactReference();
artifactRef.setGroupId( dependency.getGroupId() );
artifactRef.setArtifactId( dependency.getArtifactId() );
artifactRef.setVersion( dependency.getVersion() );
artifactRef.setClassifier( dependency.getClassifier() );
artifactRef.setType( dependency.getType() );
DependencyGraphNode toNode = new DependencyGraphNode( artifactRef );
if ( CollectionUtils.isNotEmpty( dependency.getExclusions() ) )
{