mirror of https://github.com/apache/maven.git
o give clients an easy way to retrieve a single artifact: in this case milos
wants to be able to download a javadoc JAR. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@330999 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
75731b688d
commit
3edcf5dda5
|
@ -23,6 +23,7 @@ import org.apache.maven.artifact.repository.DefaultArtifactRepository;
|
|||
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
|
||||
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
|
||||
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
|
||||
import org.apache.maven.artifact.resolver.ArtifactResolver;
|
||||
import org.apache.maven.artifact.manager.WagonManager;
|
||||
import org.apache.maven.artifact.factory.ArtifactFactory;
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
|
@ -116,6 +117,8 @@ public class MavenEmbedder
|
|||
|
||||
private ArtifactFactory artifactFactory;
|
||||
|
||||
private ArtifactResolver artifactResolver;
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Configuration
|
||||
// ----------------------------------------------------------------------
|
||||
|
@ -345,6 +348,12 @@ public class MavenEmbedder
|
|||
return artifactFactory.createArtifact( groupId, artifactId, version, type, classifier );
|
||||
}
|
||||
|
||||
public void resolve( Artifact artifact, List remoteRepositories, ArtifactRepository localRepository )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
artifactResolver.resolve( artifact, remoteRepositories, localRepository );
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Plugins
|
||||
// ----------------------------------------------------------------------
|
||||
|
@ -623,6 +632,8 @@ public class MavenEmbedder
|
|||
|
||||
artifactFactory = (ArtifactFactory) embedder.lookup( ArtifactFactory.ROLE );
|
||||
|
||||
artifactResolver = (ArtifactResolver) embedder.lookup( ArtifactResolver.ROLE );
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// If an explicit local repository has not been set then we will use the
|
||||
// setting builder to use the maven defaults to help us find one.
|
||||
|
|
Loading…
Reference in New Issue