From fcf2e3e27c39a825186af57fd4d1f89b55be4b87 Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Wed, 30 Jul 2014 15:32:54 +1000 Subject: [PATCH] make optional for Spring in case of tests that don't add any repository listeners to the classpath --- .../consumers/core/repository/RepositoryPurgeConsumer.java | 2 ++ .../archiva/metadata/repository/DefaultMetadataResolver.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumer.java index 5b6be2e8a..53c6f12c5 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumer.java @@ -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 listeners = Collections.emptyList(); /** diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java index 903aed64e..559798a62 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java @@ -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 listeners; /** -- 2.39.5