Integrating the Peer Library
This document describes how to integrate the Datomic peer library with your Java or clojure project.
Maven setup
There are two ways to install the Datomic libraries in your local maven repository. You can configure your project to use the my.datomic.com maven repository, or run an install script included with the Datomic distribution.
Datomic maven repository
Datomic Pro users can get the Datomic peer library directly from the maven repository hosted at my.datomic.com. See the download and integration instructions by logging into your account at https://my.datomic.com.
Installing from Datomic distribution
You can install the Datomic peer library in your local maven repository by running the following command from the Datomic distribution's root directory:
bin/maven-install
Or on Windows:
mvn install:install-file -DgroupId=com.datomic -DartifactId=datomic-pro -Dfile=datomic-pro-0.9.5703.jar -DpomFile=pom.xml
deps.edn
To include the datomic peer library in your deps.edn:
com.datomic/datomic-pro {:mvn/version "datomic-EDITION"}
Using from maven
To include the datomic peer library in a maven based build:
- replace VERSION in the snippet below with the contents of the VERSION file at the root of this distribution
- replace EDITION with either 'free' or 'pro' based on which edition you are installing
- add the modified snippet to the dependencies section of your pom.xml
<dependency> <groupId>com.datomic</groupId> <artifactId>datomic-EDITION</artifactId> <version>VERSION</version> </dependency>
Using from leiningen
To include the Datomic peer library in a leiningen project:
- replace VERSION in the snippet below with the contents of the VERSION file at the root of this distribution
- replace EDITION with either 'free' or 'pro' based on which edition you are installing
- Then add the snippet to the dependencies section of your project.clj:
;; in collection under :dependencies key [com.datomic/datomic-EDITION "VERSION"]
Configuring caching
Datomic peers use caching to reduce the load they place on storage. This caching can be configured at two levels: an in-process object cache, and an out-of-process use of memcached. Please see the Caching documentation for more information on cache configuration.