From e3d610646526c98bf55e89b9bbd83fbec2024c7b Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Mon, 27 Dec 2004 04:51:48 +0000 Subject: [PATCH] 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 --- .../maven/artifact/manager/DefaultWagonManager.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java b/maven-artifact/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java index 9999c13c1a..d8ed45cf94 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java @@ -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.