aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/plugins/metadata-store-jcr
diff options
context:
space:
mode:
Diffstat (limited to 'archiva-modules/plugins/metadata-store-jcr')
-rw-r--r--archiva-modules/plugins/metadata-store-jcr/pom.xml7
-rw-r--r--archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java8
-rw-r--r--archiva-modules/plugins/metadata-store-jcr/src/test/filtered-resources/META-INF/spring-context.xml4
3 files changed, 11 insertions, 8 deletions
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 @@
<artifactId>metadata-store-jcr</artifactId>
<packaging>bundle</packaging>
<name>Archiva Core Plugins :: JCR Storage for Metadata</name>
- <properties>
- <jcr-oak.version>1.7.2</jcr-oak.version>
- </properties>
<dependencies>
<dependency>
<groupId>org.apache.archiva</groupId>
@@ -65,12 +62,10 @@
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-jcr</artifactId>
- <version>${jcr-oak.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-segment-tar</artifactId>
- <version>${jcr-oak.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
@@ -124,6 +119,7 @@
<artifactId>xercesImpl</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
@@ -169,6 +165,7 @@
<artifactId>lucene-analyzers-common</artifactId>
<version>${lucene.version}</version>
</dependency>
+
</dependencies>
<build>
<testResources>
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<String, MetadataFacetFactory> 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 @@
-->
<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
+ 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">
</beans> \ No newline at end of file