///////////////////////////////////////////////////////////////////////////////

    Copyright (c) 2020 Oracle and/or its affiliates.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

///////////////////////////////////////////////////////////////////////////////

= GraalVM native image
:description: Helidon AOT using GraalVM native-image
:keywords: helidon, aot, native, native-image, image, executable, se

Helidon applications can be compiled into a native executable using GraalVM
native image.

When using applications created using the CLI, or when you configure Helidon
application pom as a parent of your module, you can use the following steps to
build a native image from your application:

1. Create an environment variable `GRAALVM_HOME` pointing to your installation of
    GraalVM with `native-image` installed
2. Run Maven command `mvn clean package -Pnative-image`
3. Execute the native executable created in `target` directory of your project

== AOT supported modules

Some Helidon components are not (yet) supported in native image, some have
restrictions. The following table lists all Helidon features and their support
for native image.

.Helidon SE features in AOT
[cols="^1,^2s,<6,<6"]
|===
| |Feature ^|Component  ^|AOT note

|✅ |Config |Config |{nbsp}
|✅ |{nbsp} |Encryption |{nbsp}
|✅ |{nbsp} |HOCON |{nbsp}
|✅ |{nbsp} |Object Mapping |{nbsp}
|✅ |{nbsp} |YAML |{nbsp}
|❓ |{nbsp} |etcd |Not yet tested.
|❓ |{nbsp} |git |Not yet tested.
|✅ |Db Client |Db Client |{nbsp}
|✅ |{nbsp} |Health Check |{nbsp}
|🔶 |{nbsp} |JDBC |Tested with h2 drivers (see examples)
|✅ |{nbsp} |Metrics |{nbsp}
|✅ |{nbsp} |Tracing |{nbsp}
|✅ |{nbsp} |mongo |{nbsp}
|✅ |Health |Health |{nbsp}
|✅ |{nbsp} |Built-ins |{nbsp}
|✅ |Messaging |Messaging |{nbsp}
|✅ |Metrics |Metrics |{nbsp}
|✅ |OpenAPI |OpenAPI |{nbsp}
|✅ |Security |Security |{nbsp}
|✅ |{nbsp} |Integration: Jersey |{nbsp}
|✅ |{nbsp} |Integration: WebServer |{nbsp}
|✅ |{nbsp} |Integration: gRPC |{nbsp}
|✅ |{nbsp} |OIDC |{nbsp}
|✅ |{nbsp} |Provider: ABAC |{nbsp}
|❓ |{nbsp} |Provider/ABAC/Policy: EL |Not yet tested.
|✅ |{nbsp} |Provider/ABAC: Role |{nbsp}
|✅ |{nbsp} |Provider/ABAC: Scope |{nbsp}
|✅ |{nbsp} |Provider/ABAC: Time |{nbsp}
|❓ |{nbsp} |Provider: Google Login |Not yet tested.
|✅ |{nbsp} |Provider: Header |{nbsp}
|✅ |{nbsp} |Provider: HTTP Basic |{nbsp}
|✅ |{nbsp} |Provider: HTTP Digest |{nbsp}
|✅ |{nbsp} |Provider: HTTP Signatures |{nbsp}
|❓ |{nbsp} |Provider: IDCS Role Mapper |Not yet tested.
|✅ |{nbsp} |Provider: JWT |{nbsp}
|✅ |Tracing |Tracing |{nbsp}
|✅ |{nbsp} |Integration: Jersey Server |{nbsp}
|✅ |{nbsp} |Integration: Jersey Client |{nbsp}
|✅ |{nbsp} |Jaeger |{nbsp}
|✅ |{nbsp} |Zipkin |{nbsp}
|✅ |WebClient |WebClient |{nbsp}
|✅ |{nbsp} |Web Client |{nbsp}
|✅ |{nbsp} |Jackson |{nbsp}
|✅ |{nbsp} |JSON-B |{nbsp}
|✅ |{nbsp} |JSON-P |{nbsp}
|✅ |{nbsp} |Metrics |{nbsp}
|✅ |{nbsp} |Multi-part |{nbsp}
|✅ |{nbsp} |Security |{nbsp}
|✅ |{nbsp} |Tracing |{nbsp}
|✅ |WebServer |WebServer |{nbsp}
|✅ |{nbsp} |Access Log |{nbsp}
|✅ |{nbsp} |CORS |{nbsp}
|✅ |{nbsp} |Jackson |{nbsp}
|✅ |{nbsp} |Jersey |{nbsp}
|✅ |{nbsp} |JSON-B |{nbsp}
|✅ |{nbsp} |JSON-P |{nbsp}
|✅ |{nbsp} |Multi-part |{nbsp}
|❓ |{nbsp} |Prometheus |Not yet tested.
|❓ |{nbsp} |Websocket |Not yet tested.
|❓ |gRPC Server |gRPC Server |Not yet tested.
|✅ |{nbsp} |Metrics |{nbsp}
|❓ |gRPC Client |gRPC Client |Not yet tested.
|✅ |{nbsp} |Metrics |{nbsp}
|===

