Have configured Spring boot 3 application running on embedded tomcat. Configured tomcat with customized context and webappclassloader to apply jakartaConverter="TOMCAT" property for javax to jakarta migration. It works fine in standalone tomcat, but spring boot 3 is not transforming 3rd party libraries from javax to jakarta. Is there anything needs to be configured?
Comment From: wilkinsona
The conversion isn't supported in Spring Boot with embedded Tomcat. In this arrangement, the classes of the application and its dependencies aren't loaded by Tomcat's WebAppClassLoader but by Spring Boot's class loader or a JDK class loader so there's no opportunity to perform the conversion. You may want to look at using something like the Eclipse Transformer to perform the conversion at build time rather than at runtime.
Comment From: chirag519086
eclipse transformer is not working for spring boot jar package. It is not iterating through libraries under boot-inf/lib generated from spring-boot-maven-plugin
Comment From: wilkinsona
The transformation should be applied at build time, before the Spring Boot uber jar is created. If you'd like some further help figuring out how to do that, please follow up on Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.
Comment From: chirag519086
Thank you for your guidance, but have tried everything to apply transformation during build time for spring boot uber jar but it wasn't transforming dependent jars which are packaged under boot-inf/lib directory. tried to execute transformer plugin on various phases but it worked only for prepare-package phase due to spring-boot-maven-plugin goal/phase conflicts. Had to write custom transformer plugin https://github.com/chirag519086/jakarta-transformer-plugin for spring boot uber jar transformation. Thanks for your valuable feedback.