add repository base to artifact files, they are expected to be absolute

git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@367176 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2006-01-09 03:32:02 +00:00
parent d23ce4c8e0
commit be4381e9b4
2 changed files with 9 additions and 8 deletions

View File

@ -31,14 +31,15 @@ import java.util.StringTokenizer;
*
* @author John Casey
* @author Brett Porter
*
* @plexus.component role="org.apache.maven.repository.discovery.ArtifactDiscoverer" role-hint="default" instantiation-strategy="per-lookup"
*/
public class DefaultArtifactDiscoverer
extends AbstractArtifactDiscoverer
implements ArtifactDiscoverer
{
/** @plexus.requirement */
/**
* @plexus.requirement
*/
private ArtifactFactory artifactFactory;
public List discoverArtifacts( File repositoryBase, String blacklistedPatterns, boolean includeSnapshots )
@ -51,7 +52,7 @@ public class DefaultArtifactDiscoverer
{
String path = artifactPaths[i];
Artifact artifact = buildArtifact( path );
Artifact artifact = buildArtifact( repositoryBase, path );
if ( artifact != null )
{
@ -65,7 +66,7 @@ public class DefaultArtifactDiscoverer
return artifacts;
}
private Artifact buildArtifact( String path )
private Artifact buildArtifact( File repositoryBase, String path )
{
List pathParts = new ArrayList();
StringTokenizer st = new StringTokenizer( path, "/\\" );
@ -215,7 +216,7 @@ public class DefaultArtifactDiscoverer
if ( finalResult != null )
{
finalResult.setFile( new File( path ) );
finalResult.setFile( new File( repositoryBase, path ) );
}
return finalResult;

View File

@ -53,7 +53,7 @@ public class LegacyArtifactDiscoverer
{
String path = artifactPaths[i];
Artifact artifact = buildArtifact( path );
Artifact artifact = buildArtifact( repositoryBase, path );
if ( artifact != null )
{
if ( includeSnapshots || !artifact.isSnapshot() )
@ -69,7 +69,7 @@ public class LegacyArtifactDiscoverer
/**
* @noinspection CollectionDeclaredAsConcreteClass
*/
private Artifact buildArtifact( String path )
private Artifact buildArtifact( File repositoryBase, String path )
{
StringTokenizer tokens = new StringTokenizer( path, "/\\" );
@ -326,7 +326,7 @@ public class LegacyArtifactDiscoverer
Artifact.SCOPE_RUNTIME, type );
}
result.setFile( new File( path ) );
result.setFile( new File( repositoryBase, path ) );
}
}
}