Hello.
I've read on https://www.linkedin.com/posts/gureev-roman_springboot-java-javadev-activity-7345764962612436992-c4bQ?utm_source=share&utm_medium=member_android&rcm=ACoAABZtGW0BD5hF4YhvmOfwFwVPw4kYJnjiMwY that @PostConstruct is now deprecated, but I can't find anything about this in the official documentation.
Is it really so? And, if it's true, can you please reflect it in the documentation?
Since this seems fishy to me, I would like to get your opinion as experts in the matter. 🙂
Kind regards and thanks.
Comment From: philwebb
It's a framework feature, but as far as I know it isn't deprecated. Documentation for the feature still exists. You should be using jakarta.annotation.PostConstruct
and not javax.annotation.PostConstruct
, perhaps that's caused the confusion.
Comment From: cdprete
Thanks for the reply @philwebb.
I'm well aware that the Jakarta annotations should be - since years - used instead. To my knowledge, the javax annotations don't even work anymore in Spring Boot 3.4.x. I claim this because I had to explicitly migrate an internal library to them to make it work again after migrating the a project using it to version 3.4.5.