From 003d5794a823d57b58ec26663fe145f31649ce31 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Mon, 24 Jul 2017 10:12:23 +1000 Subject: more progress on new maven indexer version Signed-off-by: olivier lamy --- archiva-modules/plugins/metadata-store-jcr/pom.xml | 7 ++----- .../metadata/repository/jcr/JcrRepositorySessionFactory.java | 8 +++++++- .../src/test/filtered-resources/META-INF/spring-context.xml | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'archiva-modules/plugins/metadata-store-jcr') diff --git a/archiva-modules/plugins/metadata-store-jcr/pom.xml b/archiva-modules/plugins/metadata-store-jcr/pom.xml index 94eba17a2..fc6976c08 100644 --- a/archiva-modules/plugins/metadata-store-jcr/pom.xml +++ b/archiva-modules/plugins/metadata-store-jcr/pom.xml @@ -28,9 +28,6 @@ metadata-store-jcr bundle Archiva Core Plugins :: JCR Storage for Metadata - - 1.7.2 - org.apache.archiva @@ -65,12 +62,10 @@ org.apache.jackrabbit oak-jcr - ${jcr-oak.version} org.apache.jackrabbit oak-segment-tar - ${jcr-oak.version} org.apache.jackrabbit @@ -124,6 +119,7 @@ xercesImpl test + org.apache.lucene lucene-core @@ -169,6 +165,7 @@ lucene-analyzers-common ${lucene.version} + diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java index 1c51dfc73..ed864639d 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java +++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java @@ -36,6 +36,8 @@ import javax.annotation.PostConstruct; import javax.inject.Inject; import javax.jcr.Repository; import javax.jcr.RepositoryException; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.HashMap; import java.util.Map; @@ -54,7 +56,6 @@ public class JcrRepositorySessionFactory private Map metadataFacetFactories; - @Inject private Repository repository; // Lazy evaluation to avoid problems with circular dependencies during initialization @@ -123,6 +124,11 @@ public class JcrRepositorySessionFactory JcrMetadataRepository metadataRepository = null; try { + RepositoryFactory factory = new RepositoryFactory(); + // FIXME this need to be configurable + Path directoryPath = Paths.get(System.getProperty( "appserver.base" ), "data/jcr"); + factory.setRepositoryPath( directoryPath ); + repository = factory.createRepository(); metadataRepository = new JcrMetadataRepository( metadataFacetFactories, repository ); JcrMetadataRepository.initialize( metadataRepository.getJcrSession() ); } diff --git a/archiva-modules/plugins/metadata-store-jcr/src/test/filtered-resources/META-INF/spring-context.xml b/archiva-modules/plugins/metadata-store-jcr/src/test/filtered-resources/META-INF/spring-context.xml index e3fa80bf2..c07cc52d5 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/test/filtered-resources/META-INF/spring-context.xml +++ b/archiva-modules/plugins/metadata-store-jcr/src/test/filtered-resources/META-INF/spring-context.xml @@ -19,8 +19,8 @@ --> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> \ No newline at end of file -- cgit v1.2.3