Skip to content

Commit 77f4dbb

Browse files
authored
Merge pull request #53064 from geoand/#53029
Add steps to manually create AOT file
2 parents 50d1509 + e9ec7f0 commit 77f4dbb

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

docs/src/main/asciidoc/aot.adoc

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,44 @@ You can obtain more information about AOT cache usage with the `-Xlog:aot` optio
173173
You can collect even more information in an `aot.log` file with `-Xlog:class+load=info,aot+codecache=debug:file=aot.log:level,tags`.
174174
====
175175

176+
== Manual AOT file generation
177+
178+
As explained above, Quarkus takes care of all the heavy lifting when coming to the AOT file generation. However, in cases where more control is needed, users can perform the necessary steps manually.
179+
180+
To build an application using the `aot-jar` packaging, use the following:
181+
182+
[source, bash, subs=attributes+, role="primary asciidoc-tabs-sync-maven"]
183+
.Maven
184+
----
185+
mvn package -Dquarkus.package.jar.type=aot-jar
186+
----
187+
188+
[source, bash, subs=attributes+, role="secondary asciidoc-tabs-sync-gradle"]
189+
.Gradle
190+
----
191+
./gradlew build -Dquarkus.package.jar.type=aot-jar
192+
----
193+
194+
To start the application in recording mode, use the following:
195+
196+
[source, bash, subs=attributes+, role="primary asciidoc-tabs-sync-maven"]
197+
.Maven
198+
----
199+
cd target/quarkus-app
200+
java -XX:AOTCacheOutput=app.aot -jar quarkus-run.jar
201+
----
202+
203+
[source, bash, subs=attributes+, role="secondary asciidoc-tabs-sync-gradle"]
204+
.Gradle
205+
----
206+
cd build/quarkus-app
207+
java -XX:AOTCacheOutput=app.aot-jar quarkus-run.jar
208+
----
209+
210+
After driving some load to the application, stop it. Once the process is stopped, you will notice that the `app.aot` has been created in the same directory as `quarkus-run.jar`.
211+
212+
Please refer to [JEP 514](https://openjdk.org/jeps/514) for more details.
213+
176214
== Container images
177215

178216
Quarkus can automatically build container images that include AOT caches, giving you fast startup times out of the box.

0 commit comments

Comments
 (0)