=== Native mode limitations

[IMPORTANT]
====
Due to an issue in GraalVM / Mandrel 23.1.x, you *must* build your native application with the https://quarkus.io/guides/all-config#quarkus-core_quarkus-native-report-errors-at-runtime[`--report-unsupported-elements-at-runtime`] option. You can do this by adding the following configuration to `application.properties`.

[source,properties]
----
quarkus.native.report-errors-at-runtime=true
----
====

Compilation of Groovy expressions is made with static compilation enabled. Which means that the types used in your expressions must
be known at compile time. Please refer to the https://docs.groovy-lang.org/latest/html/documentation/core-semantics.html#static-type-checking[Groovy documentation for more details].

This primarily impacts the customization of the Groovy Shell and the handling of exchange information.
In native mode, customizing the Groovy Shell and accessing the following exchange variables will not function as expected.

* `attachment`
* `exchangeProperty`
* `exchangeProperties`
* `header`
* `log`
* `variable`
* `variables`

If you use property placeholders within your expressions like.

[source,java]
----
from("direct:start")
    .transform().groovy("println '{{greeting.message}}'");
----

`greeting.message` will be evaluated once at build time and its value will be permanently stored in the native image.
It is not possible to override the value of the property at runtime. Attempting to do so will result in an exception being thrown.
