add spring aliases to prevent hackish code

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1403724 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-10-30 14:46:23 +00:00
parent 571c152ba6
commit ebaed8593c
2 changed files with 4 additions and 6 deletions

View File

@ -729,12 +729,7 @@ public class ArchivaDavResourceFactory
if ( artifact != null ) if ( artifact != null )
{ {
String repositoryLayout = managedRepository.getRepository().getLayout(); String repositoryLayout = managedRepository.getRepository().getLayout();
// FIXME we could prevent that with renaming bean repositoryStorage#maven2 to repositoryStorage#default
if ( StringUtils.equalsIgnoreCase( "default", repositoryLayout ) || StringUtils.equalsIgnoreCase(
"legacy", repositoryLayout ) )
{
repositoryLayout = "maven2";
}
RepositoryStorage repositoryStorage = RepositoryStorage repositoryStorage =
this.applicationContext.getBean( "repositoryStorage#" + repositoryLayout, RepositoryStorage.class ); this.applicationContext.getBean( "repositoryStorage#" + repositoryLayout, RepositoryStorage.class );
repositoryStorage.applyServerSideRelocation( managedRepository, artifact ); repositoryStorage.applyServerSideRelocation( managedRepository, artifact );

View File

@ -38,4 +38,7 @@
</constructor-arg> </constructor-arg>
</bean> </bean>
<alias name="repositoryStorage#maven2" alias="repositoryStorage#default"/>
<alias name="repositoryStorage#maven2" alias="repositoryStorage#legacy"/>
</beans> </beans>