aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2011-11-04 08:56:59 +0000
committerOlivier Lamy <olamy@apache.org>2011-11-04 08:56:59 +0000
commit1f57d52fa4b1be922f490e8e8a20d1558a2de190 (patch)
tree53c343289413f413ce0ff660d13467ea596c9f6e
parente11c4ccf18b63a004d1bfb139e7b7df075b2fa38 (diff)
downloadarchiva-1f57d52fa4b1be922f490e8e8a20d1558a2de190.tar.gz
archiva-1f57d52fa4b1be922f490e8e8a20d1558a2de190.zip
fix component in charge of cleaning maven index @Inject comes from a lot of packages: just use the good one :-)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1197434 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/util/MavenIndexerCleaner.java39
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/resources/repository-servlet-simple.xml6
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context-servlet-security-test.xml5
3 files changed, 27 insertions, 23 deletions
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">
+
+ <context:annotation-config/>
+ <context:component-scan base-package="org.apache.archiva.webdav.util,org.apache.archiva.common.plexusbridge"/>
+
<bean name="archivaConfiguration#default" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
<property name="registry" ref="registry#default"/>
</bean>
@@ -52,7 +56,5 @@
<bean name="componentContainer" class="org.codehaus.redback.components.springutils.ComponentContainer"/>
- <context:annotation-config/>
- <context:component-scan base-package="org.apache.archiva.webdav.util"/>
</beans> \ 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 @@
<context:property-placeholder system-properties-mode="OVERRIDE"/>
<context:annotation-config/>
- <context:component-scan base-package="org.apache.archiva.webdav,org.apache.archiva.metadata.repository"/>
+ <context:component-scan
+ base-package="org.apache.archiva.webdav,org.apache.archiva.metadata.repository,org.apache.archiva.webdav.util,org.apache.archiva.common.plexusbridge"/>
<bean name="scheduler" class="org.codehaus.redback.components.scheduler.DefaultScheduler">
<property name="properties">
@@ -46,7 +47,7 @@
<bean name="servletAuthenticator" class="org.apache.archiva.webdav.MockServletAuthenticator"/>
- <bean name="archivaConfiguration#default" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+ <bean name="archivaConfiguration#default" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
<property name="registry" ref="registry#default"/>
</bean>