Set<Artifact> dependencyArtifacts = createArtifacts( model, null );
RepositorySession repositorySession = repositorySessionFactory.createSession();
try
{
ArtifactMetadataSource metadataSource =
new MetadataArtifactMetadataSource( repositoryIds, repositorySession );
// Note that we don't permit going to external repositories. We don't need to pass in a local and remote
// since our metadata source has control over them
collector.collect( dependencyArtifacts, projectArtifact, managedVersions, null, null, metadataSource,