JCR Configuration

SeedStack JCR add-on supports any JCR-compliant Repository Content to allow your application to interface with a repository content.


Show version
dependencies {

Jackrabbit is the de-facto JCR implementation. When using Hibernate, SeedStack is able to stream results from the database without putting them all in memory (useful when retrieving for result sets).

dependencies {


SeedStack is able to automatically detect the JPA classes in your project, without persistence.xml file. You just have to declare the JPA units:

  # Configured JCR repositories with the name of the JCR repository as key.
      # Type of JCR Connection
      # Address to the JCR Server, it could be a local path, a remote server, or a JNDI Resource (Type must match the url)
      address: (String)
      # JCR Username
      username: (String)
      # JCR Password
      password: (String)
      # The fully qualified class name of the jcr factory (Optional)
      repositoryFactory: (Class<? extends JcrFactory>)
      # The Provider Properties
        prop1: value
  # Default repository to use when not specified
  defaultRepository: (String)

To dump the jcr configuration options:

mvn -q -Dargs="jcr" seedstack:config


To use the Entity Manager directly, simply inject it:

import javax.jcr.Session;

public class MyService {
    private Session myJcrSession;
    @Named("myRepository") // Optional if default repository is specified
    public void doSomethingWithMyJcrRepository() {
        // do something

All JCR Interactions should happen within the limits of a @WithContentRepository. Also, Sessions are automatically managed by the stack, there’s no need to close them.

On this page

Edit this page