diff options
author | Olivier Lamy <olamy@apache.org> | 2014-03-27 06:02:01 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2014-03-27 06:02:01 +0000 |
commit | 160189104287f7e93577d852c5afb4a68a3be0b3 (patch) | |
tree | 46955e8ab7096fbe10c4e5e313dceafd5567c53c | |
parent | bb79c82aabfc7f6624ff6b97bddd654b02dabe7d (diff) | |
download | archiva-160189104287f7e93577d852c5afb4a68a3be0b3.tar.gz archiva-160189104287f7e93577d852c5afb4a68a3be0b3.zip |
the repository session factory is now configurable via a sysprops
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1582199 13f79535-47bb-0310-9956-ffa450edef68
3 files changed, 30 insertions, 11 deletions
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/filtered-resources/application.properties b/archiva-modules/archiva-web/archiva-web-common/src/main/filtered-resources/application.properties index 12806aa73..0d2ea0035 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/filtered-resources/application.properties +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/filtered-resources/application.properties @@ -19,4 +19,4 @@ user.agent=Apache Archiva/${project.version} archiva.version=${project.version} archiva.buildNumber=${buildNumber} -archiva.timestamp=${timestamp} +archiva.timestamp=${timestamp}
\ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp/pom.xml b/archiva-modules/archiva-web/archiva-webapp/pom.xml index 8ec1bb6b1..6578ed4cc 100644 --- a/archiva-modules/archiva-web/archiva-webapp/pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp/pom.xml @@ -42,6 +42,7 @@ <test.useTomcat>false</test.useTomcat> <archiva.groupIndexTtl>30</archiva.groupIndexTtl> <archiva.sirona.configuration /> + <archiva.repositorySessionFactory.id>jcr</archiva.repositorySessionFactory.id> </properties> <dependencies> @@ -124,12 +125,17 @@ <groupId>org.apache.archiva</groupId> <artifactId>metadata-store-jcr</artifactId> </dependency> - <!-- + <dependency> <groupId>org.apache.archiva</groupId> <artifactId>metadata-store-cassandra</artifactId> </dependency> - --> + + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>metadata-store-file</artifactId> + </dependency> + <dependency> <groupId>org.apache.jackrabbit</groupId> <artifactId>jackrabbit-jcr-commons</artifactId> @@ -1005,6 +1011,7 @@ <archiva.logMissingI18n>${archiva.logMissingI18n}</archiva.logMissingI18n> <cassandra.host>localhost</cassandra.host> <cassandra.port>9160</cassandra.port> + <archiva.repositorySessionFactory.id>${archiva.repositorySessionFactory.id}</archiva.repositorySessionFactory.id> <org.apache.sirona.configuration.sirona.properties>${archiva.sirona.configuration}</org.apache.sirona.configuration.sirona.properties> </systemProperties> <additionalClasspathDirs> @@ -1090,4 +1097,13 @@ </plugins> </build> + <profiles> + <profile> + <id>cassandra</id> + <properties> + <archiva.repositorySessionFactory.id>cassandra</archiva.repositorySessionFactory.id> + </properties> + </profile> + </profiles> + </project> diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml index fc07339ff..155d08000 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml @@ -20,26 +20,29 @@ <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" - xmlns:task="http://www.springframework.org/schema/task" + xmlns:task="http://www.springframework.org/schema/task" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/task - http://www.springframework.org/schema/task/spring-task-3.0.xsd"> + http://www.springframework.org/schema/task/spring-task-3.0.xsd + http://www.springframework.org/schema/util + http://www.springframework.org/schema/util/spring-util.xsd"> - <context:property-placeholder location="classpath:application.properties"/> + <context:property-placeholder location="classpath:application.properties" /> <alias name="userConfiguration#archiva" alias="userConfiguration#default" /> <alias name="authorizer#rbac" alias="authorizer#default"/> <alias name="repositoryStatisticsManager#default" alias="repositoryStatisticsManager"/> - <!-- TODO olamy need to find a more dynamic way if using jcr impl --> - <alias name="repositorySessionFactory#jcr" alias="repositorySessionFactory"/> - <!-- - <alias name="repositorySessionFactory#cassandra" alias="repositorySessionFactory"/> - --> + <!-- so can be override with -Darchiva.repositorySessionFactory.id= jcr or cassandra or file --> + <bean name="repositorySessionFactory" class="org.apache.archiva.web.startup.RepositorySessionFactoryBean"> + <constructor-arg> + <util:properties location="classpath:archiva-runtime.properties" local-override="true"/> + </constructor-arg> + </bean> <alias name="environmentCheck#archiva-locked-admin-check" alias="environmentCheck#locked-admin-check"/> <alias name="userManager#archiva" alias="userManager#default"/> |