diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/util/MavenIndexerCleaner.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/util/MavenIndexerCleaner.java index 8c960e38f..a2bf649ca 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/util/MavenIndexerCleaner.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/util/MavenIndexerCleaner.java @@ -18,7 +18,6 @@ package org.apache.archiva.webdav.util; * under the License. */ -import com.opensymphony.xwork2.inject.Inject; import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.maven.index.NexusIndexer; import org.apache.maven.index.context.IndexingContext; @@ -31,6 +30,7 @@ import org.springframework.web.context.support.WebApplicationContextUtils; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; +import javax.inject.Inject; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; @@ -44,7 +44,25 @@ public class MavenIndexerCleaner Logger log = LoggerFactory.getLogger( getClass() ); - PlexusSisuBridge plexusSisuBridge; + private PlexusSisuBridge plexusSisuBridge; + + @Inject + private ApplicationContext applicationContext; + + @PostConstruct + public void startup() throws Exception + { + plexusSisuBridge = applicationContext.getBean( PlexusSisuBridge.class ); + cleanupIndex( ); + } + + @PreDestroy + public void shutdown() + throws Exception + { + cleanupIndex( ); + } + public void contextInitialized( ServletContextEvent servletContextEvent ) { @@ -88,22 +106,5 @@ public class MavenIndexerCleaner } } - @Inject - private ApplicationContext applicationContext; - - @PostConstruct - public void startup() throws Exception - { - plexusSisuBridge = applicationContext.getBean( PlexusSisuBridge.class ); - cleanupIndex( ); - } - - @PreDestroy - public void shutdown() - throws Exception - { - cleanupIndex( ); - } - } diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/repository-servlet-simple.xml b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/repository-servlet-simple.xml index 033af17d9..4f95eaecb 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/repository-servlet-simple.xml +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/repository-servlet-simple.xml @@ -27,6 +27,10 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd" default-lazy-init="false"> + + + + @@ -52,7 +56,5 @@ - - \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context-servlet-security-test.xml b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context-servlet-security-test.xml index b4c7d1d41..62a91b38e 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context-servlet-security-test.xml +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context-servlet-security-test.xml @@ -30,7 +30,8 @@ - + @@ -46,7 +47,7 @@ - +