return mainDep;
}
if ( mainDep == null )
{
Dependency dep = ArchivaModelCloner.clone( parentDep );
dep.setFromParent( true );
return dep;
}
Dependency merged = new Dependency();
merged.setFromParent( true );
// Unmerged.
merged.setGroupId( mainDep.getGroupId() );
merged.setArtifactId( mainDep.getArtifactId() );
// Merged.
merged.setVersion( merge( mainDep.getVersion(), parentDep.getVersion() ) );
merged.setClassifier( merge( mainDep.getClassifier(), parentDep.getClassifier() ) );
merged.setType( merge( mainDep.getType(), parentDep.getType() ) );
merged.setScope( merge( mainDep.getScope(), parentDep.getScope() ) );
if ( parentDep.isOptional() )
{
merged.setOptional( true );
}
merged.setSystemPath( merge( mainDep.getSystemPath(), parentDep.getSystemPath() ) );
merged.setUrl( merge( mainDep.getUrl(), parentDep.getUrl() ) );
merged.setExclusions( mergeExclusions( mainDep.getExclusions(), parentDep.getExclusions() ) );
return merged;
}