diff options
author | olivier lamy <olamy@apache.org> | 2017-08-19 21:37:35 +1000 |
---|---|---|
committer | olivier lamy <olamy@apache.org> | 2017-08-19 21:37:35 +1000 |
commit | 7a2710ec0a566f44a1f135b71176addfdd7047e7 (patch) | |
tree | 48886c9c6e6d66035093df4c6bbb866b83253ead /archiva-modules/archiva-base/archiva-consumers | |
parent | f93a787e74f048fd4fe393819c09d898da63b4f4 (diff) | |
parent | 88385088993b8121099f48371ce9e00689ccb547 (diff) | |
download | archiva-7a2710ec0a566f44a1f135b71176addfdd7047e7.tar.gz archiva-7a2710ec0a566f44a1f135b71176addfdd7047e7.zip |
Merge branch 'feature/jcr_oak'
Diffstat (limited to 'archiva-modules/archiva-base/archiva-consumers')
7 files changed, 60 insertions, 40 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml index f8af4626c..bb331e01e 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml @@ -86,6 +86,26 @@ <version>1.9</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.lucene</groupId> + <artifactId>lucene-core</artifactId> + <version>5.5.4</version> + </dependency> + <dependency> + <groupId>org.apache.lucene</groupId> + <artifactId>lucene-highlighter</artifactId> + <version>5.5.4</version> + </dependency> + <dependency> + <groupId>org.apache.lucene</groupId> + <artifactId>lucene-memory</artifactId> + <version>5.5.4</version> + </dependency> + <dependency> + <groupId>org.apache.lucene</groupId> + <artifactId>lucene-queries</artifactId> + <version>5.5.4</version> + </dependency> <!-- for some reasons this help sonar to run --> <dependency> diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java index 1176bc59c..715dc684c 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java @@ -56,7 +56,7 @@ public abstract class AbstractArtifactConsumerTest ArchivaConfiguration archivaConfiguration; @Inject - protected PlexusSisuBridge plexusSisuBridge; + protected NexusIndexer nexusIndexer; @Before @@ -75,7 +75,6 @@ public abstract class AbstractArtifactConsumerTest public void tearDown() throws Exception { - NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class ); for ( IndexingContext indexingContext : nexusIndexer.getIndexingContexts().values() ) { nexusIndexer.removeIndexingContext( indexingContext, false ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java index 1a997eea7..b1bd0c50d 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java @@ -98,7 +98,7 @@ public abstract class AbstractRepositoryPurgeTest protected ApplicationContext applicationContext; @Inject - protected PlexusSisuBridge plexusSisuBridge; + protected NexusIndexer nexusIndexer; @Before @@ -132,7 +132,6 @@ public abstract class AbstractRepositoryPurgeTest protected void removeMavenIndexes() throws Exception { - NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class ); for ( IndexingContext indexingContext : nexusIndexer.getIndexingContexts().values() ) { nexusIndexer.removeIndexingContext( indexingContext, false ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml index 6eed0b863..208825140 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml @@ -66,10 +66,31 @@ <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> + <exclusions> + <exclusion> + <groupId>org.apache.lucene</groupId> + <artifactId>lucene-queryparser</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache.lucene</groupId> + <artifactId>lucene-analyzers-common</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.maven.indexer</groupId> <artifactId>indexer-core</artifactId> + <classifier>shaded-lucene</classifier> + <exclusions> + <exclusion> + <groupId>org.apache.lucene</groupId> + <artifactId>lucene-queryparser</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache.lucene</groupId> + <artifactId>lucene-analyzers-common</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>javax.inject</groupId> @@ -111,21 +132,6 @@ <scope>test</scope> </dependency> <dependency> - <groupId>org.apache.jackrabbit</groupId> - <artifactId>jackrabbit-core</artifactId> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - <exclusion> - <groupId>org.slf4j</groupId> - <artifactId>jcl-over-slf4j</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <scope>test</scope> diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java index 66f067f34..8399af0bc 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java @@ -22,9 +22,6 @@ package org.apache.archiva.consumers.lucene; import org.apache.archiva.admin.model.RepositoryAdminException; import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; -import org.apache.archiva.common.plexusbridge.MavenIndexerUtils; -import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; -import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException; import org.apache.archiva.configuration.ArchivaConfiguration; import org.apache.archiva.configuration.ConfigurationNames; import org.apache.archiva.configuration.FileTypes; @@ -32,13 +29,13 @@ import org.apache.archiva.consumers.AbstractMonitoredConsumer; import org.apache.archiva.consumers.ConsumerException; import org.apache.archiva.consumers.KnownRepositoryContentConsumer; import org.apache.archiva.redback.components.registry.Registry; +import org.apache.archiva.redback.components.registry.RegistryListener; +import org.apache.archiva.redback.components.taskqueue.TaskQueueException; import org.apache.archiva.scheduler.ArchivaTaskScheduler; import org.apache.archiva.scheduler.indexing.ArtifactIndexingTask; import org.apache.maven.index.NexusIndexer; import org.apache.maven.index.context.IndexCreator; import org.apache.maven.index.context.IndexingContext; -import org.apache.archiva.redback.components.registry.RegistryListener; -import org.apache.archiva.redback.components.taskqueue.TaskQueueException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Scope; @@ -88,15 +85,13 @@ public class NexusIndexerConsumer public NexusIndexerConsumer( @Named( value = "archivaTaskScheduler#indexing" ) ArchivaTaskScheduler<ArtifactIndexingTask> scheduler, @Named( value = "archivaConfiguration" ) ArchivaConfiguration configuration, FileTypes filetypes, - PlexusSisuBridge plexusSisuBridge, MavenIndexerUtils mavenIndexerUtils, - ManagedRepositoryAdmin managedRepositoryAdmin ) - throws PlexusSisuBridgeException + List<IndexCreator> indexCreators, ManagedRepositoryAdmin managedRepositoryAdmin, NexusIndexer nexusIndexer ) { this.configuration = configuration; this.filetypes = filetypes; this.scheduler = scheduler; - this.nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class ); - this.allIndexCreators = mavenIndexerUtils.getAllIndexCreators(); + this.nexusIndexer = nexusIndexer; + this.allIndexCreators = indexCreators; this.managedRepositoryAdmin = managedRepositoryAdmin; } diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java index 5ce2781cd..91d0c107c 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java @@ -22,14 +22,15 @@ package org.apache.archiva.consumers.lucene; import junit.framework.TestCase; import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; -import org.apache.archiva.common.plexusbridge.MavenIndexerUtils; -import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.archiva.configuration.ArchivaConfiguration; import org.apache.archiva.configuration.FileTypes; +import org.apache.archiva.redback.components.taskqueue.TaskQueueException; import org.apache.archiva.scheduler.ArchivaTaskScheduler; import org.apache.archiva.scheduler.indexing.ArtifactIndexingTask; +import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; import org.apache.commons.io.FileUtils; -import org.apache.archiva.redback.components.taskqueue.TaskQueueException; +import org.apache.maven.index.NexusIndexer; +import org.apache.maven.index.context.IndexCreator; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -45,7 +46,6 @@ import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; -import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; /** * NexusIndexerConsumerTest @@ -58,7 +58,7 @@ public class NexusIndexerConsumerTest private final class ArchivaTaskSchedulerStub implements ArchivaTaskScheduler<ArtifactIndexingTask> { - Set<File> indexed = new HashSet<File>(); + Set<File> indexed = new HashSet<>(); @Override public void queueTask( ArtifactIndexingTask task ) @@ -96,10 +96,10 @@ public class NexusIndexerConsumerTest private ApplicationContext applicationContext; @Inject - private PlexusSisuBridge plexusSisuBridge; + private NexusIndexer nexusIndexer; @Inject - private MavenIndexerUtils mavenIndexerUtils; + private List<IndexCreator> indexCreators; @Inject private ManagedRepositoryAdmin managedRepositoryAdmin; @@ -119,11 +119,11 @@ public class NexusIndexerConsumerTest FileTypes filetypes = applicationContext.getBean( FileTypes.class ); nexusIndexerConsumer = - new NexusIndexerConsumer( scheduler, configuration, filetypes, plexusSisuBridge, mavenIndexerUtils, - managedRepositoryAdmin ); + new NexusIndexerConsumer( scheduler, configuration, filetypes, indexCreators, + managedRepositoryAdmin, nexusIndexer ); // initialize to set the file types to be processed - ( (NexusIndexerConsumer) nexusIndexerConsumer ).initialize(); + nexusIndexerConsumer.initialize(); repositoryConfig = new ManagedRepository(); repositoryConfig.setId( "test-repo" ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/spring-context.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/spring-context.xml index db01db735..a89137295 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/spring-context.xml @@ -59,6 +59,7 @@ <alias name="roleManager#test" alias="roleManager"/> + <!-- <bean id="jcr-config" class="org.apache.archiva.metadata.repository.jcr.ArchivaJcrRepositoryConfig" factory-method="create"> <constructor-arg value="${appserver.base}/conf/repository.xml"/> <constructor-arg value="${appserver.base}/data/jcr"/> @@ -67,7 +68,7 @@ <bean id="jcr-repository" class="org.apache.jackrabbit.core.RepositoryImpl" destroy-method="shutdown" lazy-init="true"> <constructor-arg ref="jcr-config"/> </bean> - + --> </beans>
\ No newline at end of file |