new DefaultMetadata( request.getArtifact().getGroupId(), request.getArtifact().getArtifactId(),
MAVEN_METADATA_XML, Metadata.Nature.RELEASE_OR_SNAPSHOT );
List<MetadataRequest> metadataRequests = new ArrayList<MetadataRequest>( request.getRepositories().size() );
metadataRequests.add( new MetadataRequest( metadata, null, request.getRequestContext() ) );
for ( RemoteRepository repository : request.getRepositories() )
{
MetadataRequest metadataRequest = new MetadataRequest( metadata, repository, request.getRequestContext() );
metadataRequest.setDeleteLocalCopyIfMissing( true );
metadataRequest.setTrace( trace );
metadataRequests.add( metadataRequest );
}
List<MetadataResult> metadataResults = metadataResolver.resolveMetadata( session, metadataRequests );