Repositories Metadata Content Storage

With version 2.0.2, Metadata repository content can also be stored in an Apache Cassandra database.

It's possible to switch implementation with configuring the system property (-Darchiva.repositorySessionFactory.id=) with one of the id below.

There are now 3 implementations of storage:

  • File (id: file)
  • Jackarabbit (default one) (id: jcr)
  • Cassandra (id: cassandra)

Jackrabbit

Prior to version 1.4-M1, repository content is now stored in a jcr repository (based on Apache Jackrabbit implementation).

A default Jackrabbit configuration is provided :

<Repository>
  <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
    <param name="path" value="${rep.home}/repository"/>
  </FileSystem>
  <Security appName="Jackrabbit">
    <SecurityManager class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager" workspaceName="security"/>
    <AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager"/>
    <LoginModule class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule"/>
  </Security>
  <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
  <Workspace name="${wsp.name}">
    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
      <param name="path" value="${wsp.home}"/>
    </FileSystem>
    <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager"/>
    <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
      <param name="path" value="${wsp.home}/index"/>
    </SearchIndex>
  </Workspace>
  <Versioning rootPath="${rep.home}/version">
    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
      <param name="path" value="${rep.home}/version"/>
    </FileSystem>
    <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager"/>
  </Versioning>
</Repository>

You can use your own configuration by adding a file repository.xml in ${appserver.base}/conf.

By default, the Jcr repository is stored ${appserver.base}/data/jcr.

If you want to change this default location, you must edit the file WEB-INF/applicationContext.xml, uncomment/edit lines and change with your values:

<!--
<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"/>
</bean>
-->

Cassandra

With the distribution including the embeded Jetty, you can configure Cassandra runtime in the file conf/archiva-cassandra.properties.

The default content:

cassandra.host=localhost
cassandra.port=9160
cassandra.maxActive=20
cassandra.readConsistencyLevel=QUORUM
cassandra.writeConsistencyLevel=QUORUM
cassandra.replicationFactor=1
cassandra.keyspace.name=ArchivaKeySpace
cassandra.cluster.name=archiva

If you deploy in a Web Application container, you can configure a path to this configuration file using the system property: -Darchiva.cassandra.configuration.file=