diff options
author | Olivier Lamy <olamy@apache.org> | 2012-10-30 14:46:23 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-10-30 14:46:23 +0000 |
commit | ebaed8593c32016337085246e1544d8ff5fb10a0 (patch) | |
tree | 50de761fda30f950be5f69c2c425ee9f9befa189 /archiva-modules | |
parent | 571c152ba649f7d63ce79d289726ffbb30aef674 (diff) | |
download | archiva-ebaed8593c32016337085246e1544d8ff5fb10a0.tar.gz archiva-ebaed8593c32016337085246e1544d8ff5fb10a0.zip |
add spring aliases to prevent hackish code
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1403724 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
2 files changed, 4 insertions, 6 deletions
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java index 9cdd2aaa5..d1792b33b 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java @@ -729,12 +729,7 @@ public class ArchivaDavResourceFactory if ( artifact != null ) { 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 = this.applicationContext.getBean( "repositoryStorage#" + repositoryLayout, RepositoryStorage.class ); repositoryStorage.applyServerSideRelocation( managedRepository, artifact ); diff --git a/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/spring-context.xml b/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/spring-context.xml index 1bdfede32..22de8be2a 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/spring-context.xml @@ -38,4 +38,7 @@ </constructor-arg> </bean> + <alias name="repositoryStorage#maven2" alias="repositoryStorage#default"/> + <alias name="repositoryStorage#maven2" alias="repositoryStorage#legacy"/> + </beans>
\ No newline at end of file |