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

Reply via email to