Skip to content

JaVers dependency on Google Guava #692

Description

@shirishpandharikar

As documented I just ran the below code to view the diff. It seems that Google Guava is required as a runtime dependency for the below code to work.

Javers javers = JaversBuilder.javers().build();
Person tommyOld = new Person("tommy", "Tommy Smart");
Person tommyNew = new Person("tommy", "Tommy C. Smart");

Diff diff = javers.compare(tommyOld, tommyNew);
System.out.println(diff.prettyPrint());

The code above throws an exception as shown below:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableMap
	at org.javers.core.Changes.<init>(Changes.java:35)
	at org.javers.core.diff.Diff.groupByObject(Diff.java:88)
	at org.javers.core.diff.Diff.toString(Diff.java:129)
	at org.javers.core.diff.Diff.prettyPrint(Diff.java:120)
	...
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.ImmutableMap
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 5 more

Not sure how the below line of code is used in org.javers.core.Changes.java
There are 3 more references in other classes HibernateConfig.java, JaversSpringJpaApplicationConfig.java and JaversSpringMongoApplicationConfig.java

The above code can be easily replaced with standard Java code to remove dependency on Goolge Guava.

Do let me know if these changes can be done. I will submit a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions