0
votes

I am planning to user Jackrabbit for developing an online document library. To develop simple POCs, i have put the jackrabbit-standalone.jar inside my class path and everything works fine.

But on opening the jackrabbit-standalone.jar, i found out that it's a web project in itself. I copied all the jars from jackrabbit-standalone.jar/WEB-INF/lib and kept in my class path and my project again works fine.

My concern here is that I don't want to keep any extra jars in my project. So my question is :

  • What are the minimal jars which are required to interact with Jackrabbit repository?
  • What is the best way of using jackrabbit in a web project, as per enterprise standards. Is it using standalone jar in the class path or using only the required jars?
2

2 Answers

1
votes

I won't ask why you want cut out unnecessary jars for a POC.

Do you use maven? If so, you just add jackrabbit-core and it will pull down dependencies.

If you require the JCR API you'll also need jackrabbit-spi2jcr.

Otherwise, this is what we end up with (version 2.6.4):

  • commons-collections-3.2.1.jar
  • commons-dbcp-1.3.jar
  • commons-pool-1.5.4.jar
  • concurrent-1.3.4.jar
  • jackrabbit-api-2.6.4.jar
  • jackrabbit-core-2.6.4.jar
  • jackrabbit-jcr-commons-2.6.4.jar
  • jackrabbit-spi-2.6.4.jar
  • jackrabbit-spi-commons-2.6.4.jar
  • jackrabbit-spi2jcr-2.6.4.jar
  • jcl-over-slf4j-1.6.4.jar
  • jcr-2.0.jar
  • log4j-1.2.16.jar
  • lucene-core-3.6.0.jar
  • slf4j-api-1.6.4.jar
  • slf4j-log4j12-1.6.4.jar
  • tika-core-1.3.jar

You can dispense with the logging jars if not needed. Not sure if you can get rid of lucene-core as I believe it's used internally.

Regarding how to use jackrabbit, that's entirely up to you. You can use it as standalone server or, like us, as your persistence layer. We use the JCR api.

1
votes

you can use maven or gradle to manage dependencies for you.

If you are using maven, you can find out the dependency tree with command :

mvn dependency:tree

and review the relations between artifacts.

And you can exclude parts you don't want with exclude expressions:

<dependency>
  <groupId>sample.ProjectA</groupId>
  <artifactId>Project-A</artifactId>
  <version>1.0</version>
  <scope>compile</scope>
  <exclusions>
    <exclusion>  <!-- declare the exclusion here -->
      <groupId>sample.ProjectB</groupId>
      <artifactId>Project-B</artifactId>
    </exclusion>
  </exclusions> 
</dependency>