On 3 Apr 07, at 4:55 PM 3 Apr 07, Carlos Sanchez wrote:

I need this to get a list of versions available for an artifact. I
want to do it the same way maven does to avoid inconsistencies, so the
index is not an option.

If this is for releases which is probably what the you want there are no inconsistencies and the index is actually far more reliable.

If you want up-to-date snapshots then that's a different story but I can't see the vast majority of people doing production development work being interested in that.

If you want snapshot support then it would have to be dynamic as the index is only updated on a daily basis.

This should be abstracted anyway because in the future I think leveraging the tiny index that can be pulled down locally would provide an artifact resolution mechanism that is far more reliable and an order of magnitude faster.

Jason.


On 4/2/07, Jason van Zyl <[EMAIL PROTECTED]> wrote:

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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                            -- The Princess Bride

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to