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: docs/src/docs/asciidoc/end-to-end-maven-guide.adoc
+24-6
Original file line number
Diff line number
Diff line change
@@ -261,6 +261,13 @@ For example:
261
261
</configuration>
262
262
----
263
263
264
+
Run the build command:
265
+
266
+
[source,bash, role="multi-language-sample"]
267
+
----
268
+
./mvnw -Pnative package
269
+
----
270
+
264
271
Step 2: **Gather profiles** by running the instrumented executable.
265
272
By default, the _default.iprof_ file, if not specified otherwise, is generated alongside the native executable.
266
273
@@ -282,10 +289,17 @@ You may want to provide a different name for the native image or create another
282
289
</configuration>
283
290
----
284
291
292
+
Run the build command:
293
+
294
+
[source,bash, role="multi-language-sample"]
295
+
----
296
+
./mvnw -Pnative package
297
+
----
298
+
285
299
If the profile file has the default name and location, it will be automatically picked up.
286
300
Alternatively, you can specify the file path as following: `--pgo=myprofile.iprof`.
287
301
288
-
Once the optimized image is built, run it.
302
+
Once the optimized image is built, run it: `./target/optimizedApp`.
289
303
The application's performance when running from this native executable should be comparable to, or even faster than, running on the JVM.
290
304
Learn more about PGO https://www.graalvm.org/reference-manual/native-image/optimizations-and-performance/PGO/basic-usage[on the website].
291
305
@@ -324,7 +338,7 @@ Alternatively, you can **identify missing configuration manually** using the fol
324
338
325
339
[NOTE]
326
340
====
327
-
The `--exact-reachability-metadata` option was introduced in GraalVM for JDK 23. With older versions, use `-H:ThrowMissingRegistrationErrors=` instead.
341
+
The `--exact-reachability-metadata` option was introduced in GraalVM for JDK 23. With older versions, use `-H:ThrowMissingRegistrationErrors=` instead.
328
342
====
329
343
330
344
- Rebuild the application:
@@ -338,10 +352,15 @@ The `--exact-reachability-metadata` option was introduced in GraalVM for JDK 23.
- If there is any missing metadata printed to the console, **add it to the configuration file manually**, as described https://www.graalvm.org/reference-manual/native-image/metadata/#specifying-metadata-with-json[here], or **collect it automatically using the Tracing agent**.
358
+
[NOTE]
359
+
====
360
+
With GraalVM versions older than JDK 23, pass `-H:MissingRegistrationReportingMode=Warn` at build time instead.
361
+
====
362
+
363
+
- If there is any missing metadata printed to the console, **add it to the configuration file manually**, as described https://www.graalvm.org/latest/reference-manual/native-image/metadata/#specifying-metadata-with-json[here], or **collect it automatically using the Tracing agent**.
345
364
(See next.)
346
365
347
366
- Rebuild your native image and test again.
@@ -390,7 +409,6 @@ Step 1: **Enable the agent** by setting `<agent>` to `true` in the `native` prof
390
409
</configuration>
391
410
----
392
411
From that point on, commands you execute will run with the agent attached.
393
-
By default, the agent creates the metadata in the _target/native/agent-output_ directory.
394
412
395
413
Step 2: **Copy the generated metadata** from the default location, _target/native/agent-output_, to the resources directory, for example, _resources/META-INF/native-image_.
396
414
Native Image automatically uses the metadata from this location.
@@ -424,7 +442,7 @@ Step 3: Now that the `metadataCopy` task is configured, **run the agent to colle
0 commit comments