mirror of https://github.com/apache/maven.git
o add a factory method to the wagonManager which creates an artifact as the artifact handler is required to correctly create the path for the artifact and this should all be handled internally.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163268 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
52ab7890fc
commit
e3d6106465
|
@ -20,6 +20,8 @@ package org.apache.maven.artifact.manager;
|
|||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.artifact.AbstractArtifactComponent;
|
||||
import org.apache.maven.artifact.DefaultArtifact;
|
||||
import org.apache.maven.artifact.handler.manager.ArtifactHandlerNotFoundException;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.wagon.ConnectionException;
|
||||
import org.apache.maven.wagon.ResourceDoesNotExistException;
|
||||
|
@ -48,6 +50,16 @@ public class DefaultWagonManager
|
|||
{
|
||||
private PlexusContainer container;
|
||||
|
||||
public Artifact createArtifact( String groupId, String artifactId, String version, String type )
|
||||
throws ArtifactHandlerNotFoundException
|
||||
{
|
||||
Artifact artifact = new DefaultArtifact( groupId, artifactId, version, type );
|
||||
|
||||
artifact.setPath( path( artifact ) );
|
||||
|
||||
return artifact;
|
||||
}
|
||||
|
||||
public Wagon getWagon( String protocol )
|
||||
throws UnsupportedProtocolException
|
||||
{
|
||||
|
@ -93,7 +105,6 @@ public class DefaultWagonManager
|
|||
releaseWagon( wagon );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the requested artifact from any of the remote repositories and place in
|
||||
* the specified local ArtifactRepository.
|
||||
|
|
Loading…
Reference in New Issue