maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason van Zyl <ja...@maven.org>
Subject Re: [embedder] Retrieving available versions of an artifact
Date Tue, 03 Apr 2007 00:50:51 GMT

On 2 Apr 07, at 8:22 PM 2 Apr 07, Carlos Sanchez wrote:

> I haven't found a direct way to retrieve the ArtifactMetadataSource
> instance to retrieve the list of available versions in the repository,
> I have to explicitly look it up in the plexus container.
>
> Did I miss something? if not it would be useful to expose the
> ArtifactMetadataSource or add a getAvailableVersions method to the
> embedder

What's the full use case?

  People typically use the search with the index to find all the  
available versions to, say, select a specific version of commons- 
logging. This is for the IDE and is specific to that environment.

The indexing API will be exposed in a package at Mevenide and not in  
the embedder, but that is the way users have generally been seeing  
all versions and that's how users interact with the artifact  
selection process. It's far easier using the index which is 300k  
zipped for the entire repository.

Jason.

>
>
>    public List<ArtifactVersion> getAvailableVersions(Artifact
> artifact, List<ArtifactRepository> remoteRepositories,
> ArtifactRepository localRepository)
> {
>
> ArtifactMetadataSource artifactMetadataSource =
> (ArtifactMetadataSource) mavenEmbedder.getPlexusContainer().lookup(
>                        ArtifactMetadataSource.ROLE);
>
>            return
> artifactMetadataSource.retrieveAvailableVersions(artifact,
> localRepository, remoteRepositories);
> }
>
> -- 
> I could give you my word as a Spaniard.
> No good. I've known too many Spaniards.
>                             -- The Princess Bride
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Mime
View raw message