jOOQ/jOOX

Make JAXB and java.sql dependencies optional

Opened this issue · 1 comments

jOOX is a very nice way to deal with XML on the JVM. It is also almost dependency free. Besides the obviously required dependencies on java.base and java.xml, it also unfortunately comes with hard dependencies on JAXB and java.sql.

A quick look at the code indicates that these dependencies are rather shallow. I would therefore propose replacing them with reflection and making them optional. I did this in Flyway for all kinds of third party dependencies and it worked great.

Thanks for your report.

I don't disagree, it would be better this way, on a modern JDK. In the past, both of these "dependencies" weren't special as the JDK was a big lump of APIs (including JAXB!). Suddenly, folks were interested in making things more modular and now these things have become actual dependencies.

Reflection isn't going to make everyone happy. While the "small footprint" folks might be happy, the AOT folks might not be (e.g. in Quarkus, reflection can be painful again).

Much rather, the way forward would be to extract functionality in extension modules via SPIs. Though, I don't see this as a very high priority task.