From 75a2efd2dd80edfa249a49e031f428f437357707 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Thu, 10 Jan 2008 10:54:32 +0000 Subject: remove dependency between archiva-configuration and archiva-model git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@610753 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/archiva/repository/content/LegacyPathParser.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'archiva-base/archiva-repository-layer') diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java index aceef26c1..8861b892e 100644 --- a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java +++ b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java @@ -56,19 +56,24 @@ public class LegacyPathParser public ArtifactReference toArtifactReference( String path ) throws LayoutException { + ArtifactReference artifact = new ArtifactReference(); + // First, look if a custom resolution rule has been set for this artifact Collection legacy = configuration.getConfiguration().getLegacyArtifactPaths(); for ( Iterator iterator = legacy.iterator(); iterator.hasNext(); ) { LegacyArtifactPath legacyPath = (LegacyArtifactPath) iterator.next(); if ( legacyPath.match( path ) ) - { - return legacyPath.getArtifactReference(); + { + artifact.setGroupId( legacyPath.getGroupId() ); + artifact.setArtifactId( legacyPath.getArtifactId() ); + artifact.setClassifier( legacyPath.getClassifier() ); + artifact.setVersion( legacyPath.getVersion() ); + artifact.setType( legacyPath.getType() ); + return artifact; } } - ArtifactReference artifact = new ArtifactReference(); - String normalizedPath = StringUtils.replace( path, "\\", "/" ); String pathParts[] = StringUtils.split( normalizedPath, '/' ); -- cgit v1.2.3