You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: framework-docs/modules/ROOT/pages/core/aot.adoc
+12-1
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Applying such optimizations early implies the following restrictions:
15
15
16
16
* The classpath is fixed and fully defined at build time.
17
17
* The beans defined in your application cannot change at runtime, meaning:
18
-
** `@Profile`, in particular profile-specific configuration needs to be chosen at build time.
18
+
** `@Profile`, in particular profile-specific configuration, needs to be chosen at build time and is automatically enabled at runtime when AOT is enabled.
19
19
** `Environment` properties that impact the presence of a bean (`@Conditional`) are only considered at build time.
20
20
* Bean definitions with instance suppliers (lambdas or method references) cannot be transformed ahead-of-time.
21
21
* Beans registered as singletons (using `registerSingleton`, typically from
@@ -224,6 +224,17 @@ There is a bean definition for `dataSourceConfiguration` and one for `dataSource
224
224
When a `datasource` instance is required, a `BeanInstanceSupplier` is called.
225
225
This supplier invokes the `dataSource()` method on the `dataSourceConfiguration` bean.
226
226
227
+
[[aot.running]]
228
+
== Running with AOT optimizations
229
+
230
+
AOT is a mandatory step to transform a Spring application to a native executable, so it
231
+
is automatically enabled when running in this mode. It is possible to use those optimizations
232
+
on the JVM by setting the `spring.aot.enabled` System property to `true`.
233
+
234
+
NOTE: When AOT optimizations are included, some decisions that have been taken at build-time
235
+
are hard-coded in the application setup. For instance, profiles that have been enabled at
236
+
build-time are automatically enabled at runtime as well.
0 commit comments