We just migrated our project to java 11. We configured new dependencies in the pom for the jaxb &co packages that were present in jdk-8 but were removed in jdk-11.
What we did not expect was for the deployit plugin to fail doing its job with an ugly error repeated 7 times for various classes of the same package.
NoClassDefFoundError: Unable to load builtin provider: org.jboss.resteasy.plugins.providers.jaxb.JAXBXmlSeeAlsoProvider
It was not a very big surprise. Actually, the dependencies we declared for jaxb and its kind in the pom were to make so that the required libraries would be included in the application package since they are no more available in the JDK. But deploy-it
has its own dependencies. No the trick is how to tell it to depend on jaxb?
I considered several options:
--add-modules java.xml.bind
as documented here, but the plugin does not seem to accept an <argLine>
section in its configurationI thoroughly searched the web for how to configuring dependencies for maven plugin and even on that topic, did not found much information. At most I found out about goal dependency:resolve-plugins
that gives you in theory the dependency tree of your plugins but does not seem to work much for deployit
Anyway I have the feeling that my problem might not be very uncommon, so maybe I am googling the wrong keywords. Anybody has a hint on the matter?
The solution to this problem was to use maven toolchain plugin for compiling in JDK11 while still running Maven with the JDK 8.