You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by xa...@gmail.com on 2010/03/10 12:39:09 UTC
[Maven embedder] How to retrieve the list of available versions of a
given plugin?
Hello,
I would like to know how to retrieve list of available versions of a given
plugin with the maven embedder.
In input I only have a groupId, an artifactId, a local repo and a list of
remote repos.
In output I would like to have a list containing all the available versions
of the given artifact from the local repo or from the remote repos.
Any idea?
Regards,
Xavier
Re: [Maven embedder] How to retrieve the list of available versions
of a given plugin?
Posted by Ron Wheeler <rw...@artifact-software.com>.
If you have Nexus installed, you can just go to the index, work your way
down to the artifact and see all the versions that are available.
Ron
xavier.seignard@gmail.com wrote:
> Hello,
> I would like to know how to retrieve list of available versions of a
> given plugin with the maven embedder.
>
> In input I only have a groupId, an artifactId, a local repo and a list
> of remote repos.
>
> In output I would like to have a list containing all the available
> versions of the given artifact from the local repo or from the remote
> repos.
>
> Any idea?
>
> Regards,
>
> Xavier
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [Maven embedder] How to retrieve the list of available versions
of a given plugin?
Posted by lukewpatterson <lu...@gmail.com>.
xavier.seignard wrote:
>
> I would like to know how to retrieve list of available versions of a given
> plugin with the maven embedder.
>
> In input I only have a groupId, an artifactId, a local repo and a list of
> remote repos.
>
> In output I would like to have a list containing all the available
> versions
> of the given artifact from the local repo or from the remote repos.
>
Can't tell if you're asking about programmatic access. If so, here is some
pseudo-code that will get you close enough:
</plugin>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>find-versions</id>
<phase>initialize</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>
projectArtifact = project.artifact
localRepository = session.localRepository
remoteRepositories = project.remoteArtifactRepositories
artifactMetadataSource =
session.lookup('org.apache.maven.artifact.metadata.ArtifactMetadataSource')
versions =
artifactMetadataSource.retrieveAvailableVersions(projectArtifact,
localRepository, remoteRepositories)
for(version in versions){
log.info(' found version: ' + version)
}
</source>
</configuration>
</execution>
</executions>
</plugin>
--
View this message in context: http://old.nabble.com/-Maven-embedder--How-to-retrieve-the-list-of-available-versions-of-a--given-plugin--tp27848494p27849878.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [Maven embedder] How to retrieve the list of available versions
of a given plugin?
Posted by Xavier SEIGNARD <xa...@gmail.com>.
Ok thanks,
But even if I look in the maven-versions-plugin I can't find out how
to get a list of versions of a given artifact programatically from a
given grouId, artifactId, local repo and remote repos.
Do you have a code snippet or a link to a class doing it?
Regards,
Xavier
2010/3/10, Jason van Zyl <ja...@sonatype.com>:
> The embedder doesn't currently exist anymore. I'm remaking it so it's not
> there to use. If the versions plugin doesn't do what you need internally it
> finds a list of the versions so you can borrow it's code which will work in
> maven 2 or maven 3. We've preserved the use of the old apis. The embedder is
> changing and not stable right now.
>
> On Mar 10, 2010, at 8:58 AM, xavier.seignard@gmail.com wrote:
>
>> Thanks for the tips!
>> But, I don't see how can I use the maven-version-plguin to get the list of
>> all versions available of a given artifact.
>> Can you indacate me how to do it?
>>
>> And I don't wan't to make my usage of Maven embedder dependent to Nexus
>> (which is BTW a great tool).
>>
>> Thanks for your answers.
>>
>> Xavier
>>
>> Le , Jason van Zyl <ja...@sonatype.com> a écrit :
>>> I suggest using the maven-versions-plugin:
>>
>>
>>
>>> http://mojo.codehaus.org/versions-maven-plugin/index.html
>>
>>
>>
>>> On Mar 10, 2010, at 6:39 AM, xavier.seignard@gmail.com wrote:
>>
>>
>>
>>> > Hello,
>>
>>> > I would like to know how to retrieve list of available versions of a
>>> > given plugin with the maven embedder.
>>
>>> >
>>
>>> > In input I only have a groupId, an artifactId, a local repo and a list
>>> > of remote repos.
>>
>>> >
>>
>>> > In output I would like to have a list containing all the available
>>> > versions of the given artifact from the local repo or from the remote
>>> > repos.
>>
>>> >
>>
>>> > Any idea?
>>
>>> >
>>
>>> > Regards,
>>
>>> >
>>
>>> > Xavier
>>
>>
>>
>>> Thanks,
>>
>>
>>
>>> Jason
>>
>>
>>
>>> ----------------------------------------------------------
>>
>>> Jason van Zyl
>>
>>> Founder, Apache Maven
>>
>>> http://twitter.com/jvanzyl
>>
>>> ----------------------------------------------------------
>>
>>
>>
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder, Apache Maven
> http://twitter.com/jvanzyl
> ----------------------------------------------------------
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [Maven embedder] How to retrieve the list of available versions of a given plugin?
Posted by Jason van Zyl <ja...@sonatype.com>.
The embedder doesn't currently exist anymore. I'm remaking it so it's not there to use. If the versions plugin doesn't do what you need internally it finds a list of the versions so you can borrow it's code which will work in maven 2 or maven 3. We've preserved the use of the old apis. The embedder is changing and not stable right now.
On Mar 10, 2010, at 8:58 AM, xavier.seignard@gmail.com wrote:
> Thanks for the tips!
> But, I don't see how can I use the maven-version-plguin to get the list of all versions available of a given artifact.
> Can you indacate me how to do it?
>
> And I don't wan't to make my usage of Maven embedder dependent to Nexus (which is BTW a great tool).
>
> Thanks for your answers.
>
> Xavier
>
> Le , Jason van Zyl <ja...@sonatype.com> a écrit :
>> I suggest using the maven-versions-plugin:
>
>
>
>> http://mojo.codehaus.org/versions-maven-plugin/index.html
>
>
>
>> On Mar 10, 2010, at 6:39 AM, xavier.seignard@gmail.com wrote:
>
>
>
>> > Hello,
>
>> > I would like to know how to retrieve list of available versions of a given plugin with the maven embedder.
>
>> >
>
>> > In input I only have a groupId, an artifactId, a local repo and a list of remote repos.
>
>> >
>
>> > In output I would like to have a list containing all the available versions of the given artifact from the local repo or from the remote repos.
>
>> >
>
>> > Any idea?
>
>> >
>
>> > Regards,
>
>> >
>
>> > Xavier
>
>
>
>> Thanks,
>
>
>
>> Jason
>
>
>
>> ----------------------------------------------------------
>
>> Jason van Zyl
>
>> Founder, Apache Maven
>
>> http://twitter.com/jvanzyl
>
>> ----------------------------------------------------------
>
>
>
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------
Re: Re: [Maven embedder] How to retrieve the list of available
versions of a given plugin?
Posted by xa...@gmail.com.
Thanks for the tips!
But, I don't see how can I use the maven-version-plguin to get the list of
all versions available of a given artifact.
Can you indacate me how to do it?
And I don't wan't to make my usage of Maven embedder dependent to Nexus
(which is BTW a great tool).
Thanks for your answers.
Xavier
Le , Jason van Zyl <ja...@sonatype.com> a écrit :
> I suggest using the maven-versions-plugin:
> http://mojo.codehaus.org/versions-maven-plugin/index.html
> On Mar 10, 2010, at 6:39 AM, xavier.seignard@gmail.com wrote:
> > Hello,
> > I would like to know how to retrieve list of available versions of a
> given plugin with the maven embedder.
> >
> > In input I only have a groupId, an artifactId, a local repo and a list
> of remote repos.
> >
> > In output I would like to have a list containing all the available
> versions of the given artifact from the local repo or from the remote
> repos.
> >
> > Any idea?
> >
> > Regards,
> >
> > Xavier
> Thanks,
> Jason
> ----------------------------------------------------------
> Jason van Zyl
> Founder, Apache Maven
> http://twitter.com/jvanzyl
> ----------------------------------------------------------
Re: [Maven embedder] How to retrieve the list of available versions of a given plugin?
Posted by Jason van Zyl <ja...@sonatype.com>.
I suggest using the maven-versions-plugin:
http://mojo.codehaus.org/versions-maven-plugin/index.html
On Mar 10, 2010, at 6:39 AM, xavier.seignard@gmail.com wrote:
> Hello,
> I would like to know how to retrieve list of available versions of a given plugin with the maven embedder.
>
> In input I only have a groupId, an artifactId, a local repo and a list of remote repos.
>
> In output I would like to have a list containing all the available versions of the given artifact from the local repo or from the remote repos.
>
> Any idea?
>
> Regards,
>
> Xavier
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------