{
Map managedVersions =
createManagedVersionMap( getArtifactFactory(), project.getId(),
project.getDependencyManagement() );
ArtifactResolutionResult artifactResolutionResult = null;
try
{
List listeners = new ArrayList();
if ( logger.isDebugEnabled() )
{
listeners.add( new DebugResolutionListener( logger ) );
}
listeners.add( new WarningResolutionListener( logger ) );
artifactResolutionResult =
artifactCollector.collect( getProjectArtifacts(), project.getArtifact(), managedVersions,
localRepo, project.getRemoteArtifactRepositories(),
getArtifactMetadataSource(), null, listeners );
}
catch ( ArtifactResolutionException e )
{
getLog().debug( e.getMessage(), e );
getLog().error(
Messages.getString( "artifactresolution", new Object[] { //$NON-NLS-1$
e.getGroupId(), e.getArtifactId(), e.getVersion(),
e.getMessage() } ) );
// if we are here artifactResolutionResult is null, create a project without dependencies but
// don't fail
// (this could be a reactor projects, we don't want to fail everything)
// Causes MECLIPSE-185. Not sure if it should be handled this way??
return new IdeDependency[0];
}
// keep track of added reactor projects in order to avoid duplicates
Set emittedReactorProjectId = new HashSet();
for ( Iterator i = artifactResolutionResult.getArtifactResolutionNodes().iterator(); i.hasNext(); )
{
ResolutionNode node = (ResolutionNode) i.next();
int dependencyDepth = node.getDepth();
Artifact art = node.getArtifact();