JaVers needs funding to sustain. You can sponsor JaVers development easily via GitHub Sponsors or Open Collective.

Getting started

Get JaVers

JaVers artifacts are published to Maven Central. To get JaVers, add javers-core to your project dependencies and (optionally) choose proper javers-repository module.



compile 'org.javers:javers-core:5.10.3'



If you’re going to use JaVers as an object diff tool, this is the only dependency you need.


If you are going to use JaVers as a data audit framework, choose the proper repository implementation. For example, if you’re using MongoDB add:


compile 'org.javers:javers-persistence-mongo:5.10.3'



Create a JaVers instance

Use JaversBuilder to create a JaVers instance:

import org.javers.core.Javers;
import org.javers.core.JaversBuilder;
Javers javers = JaversBuilder.javers().build();

Now, the JaVers instance is up and ready, configured with reasonable defaults. Good enough to start.

Later on, you would probably need to refine the configuration and introduce some basic facts about your domain model to JaVers.

Object diff

Use the compare() method to calculate a diff for two arbitrary complex domain objects:

Person tommyOld = new Person("tommy", "Tommy Smart");
Person tommyNew = new Person("tommy", "Tommy C. Smart");

Diff diff = javers.compare(tommyOld, tommyNew);

See more diff examples.

Object audit

Use the commit() method to persist changes done on domain objects in JaversRepository:

Person robert = new Person("bob", "Robert Martin");
javers.commit("user", robert);

See more audit examples.