public List retrieveAvailableVersions( Artifact artifact, ArtifactRepository localRepository,
List remoteRepositories )
throws ArtifactMetadataRetrievalException
{
RepositoryMetadata metadata = new ArtifactRepositoryMetadata( artifact );
try
{
repositoryMetadataManager.resolve( metadata, remoteRepositories, localRepository );
}
catch ( RepositoryMetadataResolutionException e )
{
throw new ArtifactMetadataRetrievalException( e.getMessage(), e );
}
List versions;
Metadata repoMetadata = metadata.getMetadata();
if ( repoMetadata != null && repoMetadata.getVersioning() != null )
{
List metadataVersions = repoMetadata.getVersioning().getVersions();
versions = new ArrayList( metadataVersions.size() );
for ( Iterator i = metadataVersions.iterator(); i.hasNext(); )