From 6f6884233de696c4fb653380f280c7ad5003b13e Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Fri, 17 Jul 2009 13:55:31 +0000 Subject: [PATCH] o Fixed injection of repository layouts git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@795086 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/repository/LegacyRepositorySystem.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/maven-compat/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java b/maven-compat/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java index 10eeb66ddf..f8bd253fce 100644 --- a/maven-compat/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java +++ b/maven-compat/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java @@ -74,11 +74,8 @@ public class LegacyRepositorySystem @Requirement private ArtifactRepositoryFactory artifactRepositoryFactory; - @Requirement - private ArtifactRepositoryLayout defaultArtifactRepositoryLayout; - - @Requirement - private Map layouts; + @Requirement( role = ArtifactRepositoryLayout.class ) + private Map layouts; @Requirement private MirrorBuilder mirrorBuilder; @@ -533,16 +530,16 @@ public class LegacyRepositorySystem ArtifactRepositoryPolicy releasesPolicy = new ArtifactRepositoryPolicy( releases, releaseUpdates, checksumPolicy ); - return createArtifactRepository( repositoryId, url, defaultArtifactRepositoryLayout, snapshotsPolicy, releasesPolicy ); + return createArtifactRepository( repositoryId, url, null, snapshotsPolicy, releasesPolicy ); } public ArtifactRepository createArtifactRepository( String repositoryId, String url, ArtifactRepositoryLayout repositoryLayout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases ) - { + { if ( repositoryLayout == null ) { - repositoryLayout = defaultArtifactRepositoryLayout; + repositoryLayout = layouts.get( "default" ); } - + ArtifactRepository artifactRepository = artifactRepositoryFactory.createArtifactRepository( repositoryId, url, repositoryLayout, snapshots, releases ); Authentication authentication = authentications.get( repositoryId );