Glassfish has whole bunch of third-side libraries stored in its modules
directory. To my surprise, if my project uses a library which is present there, Glassfish will provide it from there, instead of the right version I have packed-in in my WAR file.
This leads to a number of errors. For example, I use jackson-datatype-joda
version 2.6.3, which requires jackson-databind
with same version, and it is included in my project. But Glassfish replaces that package with version 2.3.2, which leads to this issue.
How can I prevent Glassfish (4.1) from replacing the libraries I use with another versions?