We have recently upgraded a Spring Boot 2.7.x application to 3.3.x. This application is deployed for customers on different clouds so we have to rely on @Profile and @ConditionalOnBean annotations. An example is given below:
interface FileStorageService {
void saveFile(String filePath, byte[] fileContent);
byte[] getFile(String filePath);
}
@ConditionalOnBean(AWSRuntime.class)
@Service
class AmazonS3StorageService implements FileStorageService {}
@ConditionalOnBean(AzureRuntime.class)
@Service
class AzureBlobStorageService implements FileStorageService {}
@ConditionalOnBean(GCPRuntime.class)
@Service
class GoogleCloudStorageService implements FileStorageService {}
How can we generate a GraalVM native image for this application? We are even open to the idea of generating separate images at build time.
Comment From: bclozel
Hello @manish-in-java
This is a well-known limitation of the AOT engine as described in the Spring Framework reference docs. For now, there is no plan in Spring Framework to work on this limitation.
You will find other known issues on the Spring Boot wiki page.