I tried to upgrade jakarta.annotation:jakarta.annotation-api from 1.3.5 to 2.0.0 The annotations moved from package javax.annotation to jakarta.annotation. After the Upgrade @PostConstruct and @PreDestroy are not working. Please let annotations from both packages work in CommonAnnotationBeanPostProcessor.
Comment From: jhoeller
I'm afraid there are no plans for such parallel support for both EE namespaces in the Spring Framework 5.x generation. While we could rather easily implement this for @PostConstruct
and @PreDestroy
, it's harder for @Inject
and its Provider
interface already, requires duplicated modules for JPA and JMS, and is effectively impossible for Spring MVC on the Servlet API. We intend to do a full switch in the Spring Framework 6 generation (see #25354), possibly along with support for Jakarta EE 10 next year.
Please note that Jakarta EE 9 is a plain repackaging and does not provide new features yet. What's your motivation for using the Commons Annotations API 2.0 over 1.3 there? In what way is that one worth upgrading in a singular fashion while consuming the other EE APIs from the javax
namespace still?
Comment From: qeepcologne
Thanks for the quick response and the detailed explanations. There is no requirement for the upgrade, i just prefer gradual upgrade over big bang. Otherwise upgrade (tomcat10,spring,spring-security, jakarta apis and probably a lot more) is such a big brick and not integrated timely. I already switched some apis like jakarta.mail-api and jakarta.xml.bind-api and nearly none of these run smoothly without changes.
Comment From: hantsy
Before Spring framework moving to the Jakarta EE 9/10 stack. I hope Spring can consider releasing a Jakarta EE 9.0 version alongside the Jakarta EE 8.0 release(eg. a Maven artifact classifier jakartaee9 or a specific version) at the same time. There are several projects that used Eclipse Transformer tooling to transfer the existing work to Jakarta EE 9, such as Apache TomEE, WildFly 22.0.0 Jakarta EE preview.
Comment From: hantsy
I created an issue for this, https://github.com/spring-projects/spring-framework/issues/26224