Return-Path: Delivered-To: apmail-maven-dev-archive@www.apache.org Received: (qmail 55118 invoked from network); 4 Apr 2007 02:15:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Apr 2007 02:15:03 -0000 Received: (qmail 44753 invoked by uid 500); 4 Apr 2007 02:15:08 -0000 Delivered-To: apmail-maven-dev-archive@maven.apache.org Received: (qmail 44697 invoked by uid 500); 4 Apr 2007 02:15:08 -0000 Mailing-List: contact dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Developers List" Reply-To: "Maven Developers List" Delivered-To: mailing list dev@maven.apache.org Received: (qmail 44685 invoked by uid 99); 4 Apr 2007 02:15:08 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 19:15:08 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [63.246.7.148] (HELO mail.maven.org) (63.246.7.148) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 19:14:59 -0700 Received: (qmail 1524 invoked by uid 89); 4 Apr 2007 02:14:38 -0000 Received: from unknown (HELO ??CIPv6:::1?) (jason@maven.org@127.0.0.1) by mail.maven.org with ESMTPA; 4 Apr 2007 02:14:38 -0000 Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <1a5b6c410704031355h7b137826w3b45ab3bd606ffe7@mail.gmail.com> References: <1a5b6c410704021722t37948c0fn7d3877286fbf3cb0@mail.gmail.com> <0E8F9605-37E7-4453-8C4A-36F5AA791D1A@maven.org> <1a5b6c410704031355h7b137826w3b45ab3bd606ffe7@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Jason van Zyl Subject: Re: [embedder] Retrieving available versions of an artifact Date: Tue, 3 Apr 2007 22:14:16 -0400 To: "Maven Developers List" X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org 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 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 getAvailableVersions(Artifact >> > artifact, List 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 >> >> > > > -- > 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