Example usage for org.apache.maven.project.artifact MavenMetadataSource MavenMetadataSource

List of usage examples for org.apache.maven.project.artifact MavenMetadataSource MavenMetadataSource

Introduction

In this page you can find the example usage for org.apache.maven.project.artifact MavenMetadataSource MavenMetadataSource.

Prototype

MavenMetadataSource

Source Link

Usage

From source file:com.googlecode.jndiresources.maven.MavenEmbedder.java

License:Apache License

/**
 * Resolve all artifact./*w w w  .  jav a 2  s.co m*/
 * 
 * @param artifact The artifact to resolve.
 * @param remoteRepositories A list of remote repositories.
 * @param localRepository The local repository.
 * 
 * @throws ArtifactResolutionException If it's impossible to resolve artifact.
 * @throws ArtifactNotFoundException If the artifact is not found.
 */
public void resolveAll(final Artifact artifact, final List remoteRepositories,
        final ArtifactRepository localRepository)
        throws ArtifactResolutionException, ArtifactNotFoundException {
    final Set set = new HashSet();
    set.add(artifact);
    final ArtifactResolutionResult result = artifactResolver_.resolveTransitively(set, artifact,
            remoteRepositories, localRepository, new MavenMetadataSource());
    // TODO : J'ai ajout maven-project pour cela :-( Est-ce vraiement ncessaire ?
    for (final Iterator i = result.getArtifacts().iterator(); i.hasNext();) {
        System.out.println(i.next());
    }
}