o Fixed injection of repository layouts

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@795086 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-07-17 13:55:31 +00:00
parent 13ddca24aa
commit 6f6884233d
1 changed files with 6 additions and 9 deletions

View File

@ -74,10 +74,7 @@ public class LegacyRepositorySystem
@Requirement
private ArtifactRepositoryFactory artifactRepositoryFactory;
@Requirement
private ArtifactRepositoryLayout defaultArtifactRepositoryLayout;
@Requirement
@Requirement( role = ArtifactRepositoryLayout.class )
private Map<String, ArtifactRepositoryLayout> layouts;
@Requirement
@ -533,14 +530,14 @@ 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 );