Spring AutoReconfiguration will be no longer installed for Spring Boot 3 applications since JBP v4.62.0
Checklist:
From v4.62.0, the Java Buildpack will no longer install the Spring AutoReconfiguration (SAR) library for Spring Boot 3 applications. This library was deprecated in May 2022 and performs overwriting of your configured Spring Beans to connect to bound services. This is not recommended for use in production environments and the recommended replacement is the Java CfEnv library.
Applications should not be affected by this change if:
* the buildpack will not install Java CfEnv if it is already detected as an app dependency
Your applications might be affected by the following 2 scenarios:
If your application is affected by above 2 scenarios, please see following instructions for troubleshooting.
First check the following set of conditions, all of which must be present:
<bean-name> bean of type with <bean-type> reconfigured with <service-name> bean
For example: 'dataSource' bean of type with 'javax.sql.DataSource' reconfigured with 'mysql' bean
In most cases, the Java CfEnv library should replace the functionality of the Spring AutoReconfiguration library for Spring Boot 3 apps without any manual intervention. The Java CfEnv library examines bound services of the above types (except SMTP) and sets well-known Spring Boot properties so that Spring Boot's Autoconfiguration can kick-in.
Use cases that will not be handled automatically by the switch from SAR to Java CfEnv in v4.62.0 of the buildpack and workarounds:
Java CfEnv is not compatible with Spring Cloud Connectors (deprecated in 2019) and applications that use both and are bound to one of the above services, will fail to start. Since the buildpack will install Java CfEnv for Boot 3 applications from Java Buildpack version 4.62.0, it will conflict with any manually added Spring Cloud Connectors dependency.
You can identify if the application uses Spring Boot 3 and does have Spring Cloud Connectors as a dependency if you see the following error:
java.lang.IllegalStateException: Exiting the application since the Spring Cloud Connector library has been detected on the classpath. Please remove this dependency from your project and set the environment variable JBP_CONFIG_SPRING_AUTO_RECONFIGURATION '{enabled: false}' in the Cloud Foundry manifest.
Workaround: