Skip to content

Commit 57ddb20

Browse files
committed
Clarify that Spring AOT imposes further restrictions
Closes gh-35032
1 parent bf19579 commit 57ddb20

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/native-image/introducing-graalvm-native-images.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ The main differences are:
2727
* There is no lazy class loading, everything shipped in the executables will be loaded in memory on startup.
2828
* There are some limitations around some aspects of Java applications that are not fully supported.
2929

30+
On top of those differences, Spring uses a process called <<native-image#native-image.introducing-graalvm-native-images.understanding-aot-processing, Spring Ahead-of-Time processing>>, which imposes further limitations.
31+
Please make sure to read at least the beginning of the next section to learn about those.
32+
3033
TIP: The {graal-native-image-docs}/metadata/Compatibility/[Native Image Compatibility Guide] section of the GraalVM reference documentation provides more details about GraalVM limitations.
3134

3235

@@ -39,12 +42,11 @@ In fact, the concept of Spring Boot auto-configuration depends heavily on reacti
3942
Although it would be possible to tell GraalVM about these dynamic aspects of the application, doing so would undo most of the benefit of static analysis.
4043
So instead, when using Spring Boot to create native images, a closed-world is assumed and the dynamic aspects of the application are restricted.
4144

42-
A closed-world assumption implies the following restrictions:
45+
A closed-world assumption implies, besides <<native-image#native-image.introducing-graalvm-native-images.key-differences-with-jvm-deployments, the limitations created by GraalVM itself>>, the following restrictions:
4346

44-
* The classpath is fixed and fully defined at build time
4547
* The beans defined in your application cannot change at runtime, meaning:
4648
- The Spring `@Profile` annotation and profile-specific configuration <<howto#howto.aot.conditions,have limitations>>.
47-
- Properties that change if a bean is created are not supported (for example, `@ConditionalOnProperty` and `.enable` properties).
49+
- Properties that change if a bean is created are not supported (for example, `@ConditionalOnProperty` and `.enable` properties).
4850

4951
When these restrictions are in place, it becomes possible for Spring to perform ahead-of-time processing during build-time and generate additional assets that GraalVM can use.
5052
A Spring AOT processed application will typically generate:

0 commit comments

Comments
 (0)