List<Artifact> artifactDownloadInfos = new ArrayList<Artifact>();
RepositorySession session = repositorySessionFactory.createSession();
MetadataResolver metadataResolver = session.getResolver();
try
{
for ( String repoId : selectedRepos )
{
List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>(
metadataResolver.resolveArtifacts( session, repoId, groupId, artifactId, version ) );
Collections.sort( artifacts, ArtifactMetadataVersionComparator.INSTANCE );
if ( artifacts != null && !artifacts.isEmpty() )
{
return buildArtifacts( artifacts, repoId );
}