The solution is very easy:
- Find the jar that invokes the native library.
- Locate the dependency
for that jar in the pom.xml file.
- Move the dependency so that it is inside the dependencies section
of the Jetty plugin. By making it a dependency of the Jetty plugin (as opposed to a dependency of your application), Jetty won't try to reload it and won't mess up the classloaders
Kudos to David Yu's suggestion on a forum.