Similar to #35433.
Comment from Andy:
The Maven side of things is more complicated for the reasons that Moritz described here. We could filter out spring-boot-devtools and spring-boot-docker-compose from the AOT processing classpath, but we don't have that level of control over the native image classpath. That's why we ended up with https://github.com/spring-projects/spring-boot/commit/b9ae61fc109f71902125230bccd162c31461ab19 to disable DevTools in a native image. I think we'll have to do something similar for the Docker Compose support.
Comment From: philwebb
I'm not sure we can use NativeDetector because we need to disable before bean definitions are added.