make optional for Spring

in case of tests that don't add any repository listeners to the classpath
This commit is contained in:
Brett Porter 2014-07-30 15:32:54 +10:00
parent 54f97d54cb
commit fcf2e3e27c
2 changed files with 4 additions and 0 deletions

View File

@ -37,6 +37,7 @@ import org.apache.archiva.repository.RepositoryNotFoundException;
import org.apache.archiva.repository.events.RepositoryListener;
import org.apache.archiva.repository.metadata.MetadataTools;
import org.apache.archiva.redback.components.registry.RegistryListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
@ -98,6 +99,7 @@ public class RepositoryPurgeConsumer
*
*/
@Inject
@Autowired(required = false)
private List<RepositoryListener> listeners = Collections.emptyList();
/**

View File

@ -33,6 +33,7 @@ import org.apache.archiva.redback.components.cache.Cache;
import org.apache.archiva.repository.events.RepositoryListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.inject.Inject;
@ -78,6 +79,7 @@ public class DefaultMetadataResolver
private RepositoryStorage repositoryStorage;
@Inject
@Autowired(required = false)
private List<RepositoryListener> listeners;
/**