JaVers dependency on Google Guava
See original GitHub issueAs 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.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Release notes — JaVers Documentation
5.8.12. released on 2020-03-31. 951 Dependencies management fix in javers-core . Guava and joda-time are now correctly marked as optional in pom.xml ....
Read more >org.javers : javers-persistence-mongo : 5.11.2 - Maven Central
Dependencies : org.javers:javers-core · org.mongodb:mongodb-driver-legacy · com.google.guava:guava.
Read more >Duplicate class in modules error when I try to use Javers in ...
You should get to the bottom of your dependencies and really understand what you are pulling in, but a quick fix could be...
Read more >org.javers » javers-core » 6.7.1 - Maven Repository
Compile Dependencies (4) ; JSON Lib Apache 2.0, logo, com.google.code.gson » gson ; Core Utils Apache 2.0, logo, com.google.guava » guava ( ...
Read more >org.javers.guava.MultimapTypeAdapter Maven / Gradle / Ivy
org.javers.guava.MultimapTypeAdapter maven / gradle build tool code. The class is part of the package ➦ Group: org.javers ➦ Artifact: javers-core ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@PodusovMaxim Thanks for reporting this. This is something that got added after #692 was reported and fixed. Will submit a PR.
fixed in 5.10.3