I need to run a test over a JEE application using com.fasterxml.jackson.core library to determine which version of jackson API has been loaded in memory.
I took a look at its API but I couldn't find so far any static class.method returning an instance of com/fasterxml/jackson/core/Version.java
Can you advice me a way to check the library version being used ?
Thanks
Asked
Active
Viewed 5,449 times
7

Carla
- 3,064
- 8
- 36
- 65
1 Answers
16
Version
class appears to be in use in most public components of Jackson, e.g.:
ObjectMapper om = new ObjectMapper();
Version version = om.version();
System.out.println(version);
or
Version version = com.fasterxml.jackson.databind.cfg.PackageVersion.VERSION;
System.out.println(version);
or
Version version = com.fasterxml.jackson.core.json.PackageVersion.VERSION;
System.out.println(version);
Look for classes implementing com.fasterxml.jackson.core.Versioned
interface, which provides the version()
method.

Henrik Aasted Sørensen
- 6,966
- 11
- 51
- 60
-
2Thank you very much! it helped a lot! – Carla Oct 30 '17 at 08:58