Is it possible/feasable to write libraries that can be consumed by Jakarta AND Spring projects?

Viewed 22

At my workplace, we develop many different backend applications for many different customers. Some of them use Spring Boot, while others use JavaEE/Jakarta. For the JavaEE apps we have some shared libraries that are used by many projects, but these libraries can only be consumed by JavaEE projects, since the libraries use EJB and CDI beans, MicroProfile config and other EE specific concepts.

Is there a way to develop such libraries, so that they can be used as a Spring library as well as a JavaEE library? what would that entail?

I assume, one would need a core that is technology agnostic and two wrapper libraries that add the Spring and EE flavors respectively. Or is there a more light-weight solution? I cannot find very much information out there; my search results are cluttered with "Why X is better than Y" articles ^^'

0 Answers
Related