Hello,

Tested with: latest gradle version: 7.0.2 latest spring boot plugin version: 2.5.1

According to the spring boot gradle plugin 2.5 release notes gradle configuration cache feature is supported: https://docs.spring.io/spring-boot/docs/2.5.0/gradle-plugin/reference/htmlsingle/#introduction

But configuration cache breaks due to the spring boot plugin using the project object during execution time: https://github.com/spring-projects/spring-boot/blob/703eaa71f474302932c63b6dba6e8bc932faaa0f/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java#L250

Here is the explanation from gradle. https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

There may be other places this is being done so it's probably worth checking globally. As these issues are detected at runtime by gradle I would suggest having a separate build with the configuration cache flag enabled maybe.

Comment From: wilkinsona

We added support for the configuration cache in Spring Boot 2.4 and have quite a few tests for it already. It looks like we may have missed the case where spring-boot-configuration-processor is on the annotation processor path but it should work fine in general. So that we can be sure that we fully understand the problem that you're seeing, can you please provide a minimal sample that reproduces the problem? You can share it with us by zipping it up and attaching it to this issue or by pushing it to a separate repository on GitHub.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: high-stakes

Hi, the problem is indeed caused by the spring boot configuration processor, removing it (from the annotationProcessor configuration) does not trigger the codebranch mentioned. However meanwhile another issue I found is with the spring boot dependency management plugin which breaks when importing a bom. It seems to be because of the version properties populated from the boms. Is this the right place to report that as well? Should be very simple to reproduce but if not I will set up an example.

Comment From: wilkinsona

Hi, the problem is indeed caused by the spring boot configuration processor, removing it (from the annotationProcessor configuration) does not trigger the codebranch mentioned.

Thanks for the clarification.

However meanwhile another issue I found is with the spring boot dependency management plugin which breaks when importing a bom. It seems to be because of the version properties populated from the boms. Is this the right place to report that as well? Should be very simple to reproduce but if not I will set up an example.

The dependency management plugin is managed as a separate project. Please open an issue over there. I cannot reproduce the problem with a typical Spring Boot project – the implicitly imported spring-boot-dependencies bom works as expected with the configuration cache enabled – so it'd be great if you could set up an example.