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: build_and_execute_guide.adoc
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
6
6
// optional variables:
7
7
// network_container - if the generated Docker container needs to run on the same network as an external dependency, this is the name of that container dependency
8
-
// custom_hint_include_file - if the native compilation section needs additional description in the form of a custom hint, this is the file that should be rendered as additional content
8
+
// omit_native_build - set if the native compilation section is not to be rendered
9
9
10
10
ifeval::["{build_system}" == "gradle"]
11
11
@@ -69,14 +69,16 @@ endif::[]
69
69
70
70
== Building the Application
71
71
72
-
In this section, we will describe four different ways to run this guide:
72
+
This section describes different ways to run this guide:
73
73
74
74
1. https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.build-systems[Building and executing a JAR file]
75
75
2. https://docs.spring.io/spring-boot/docs/current/reference/html/container-images.html#container-images.buildpacks[Building and executing a Docker container using Cloud Native Buildpacks^]
76
+
ifndef::omit_native_build[]
76
77
3. https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html#native-image.developing-your-first-application.native-build-tools[Building and executing a native image^]
77
78
4. https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html#native-image.developing-your-first-application.buildpacks[Building and executing a native image container using Cloud Native Buildpacks^]
79
+
endif::[]
78
80
79
-
Regardless of how you choose to execute the application, the output should be the same.
81
+
Regardless of how you choose to run the application, the output should be the same.
80
82
81
83
To run the application, you can package the application as an executable jar.
82
84
The `{jar_build_command}` command compiles the application to an executable jar.
@@ -94,6 +96,7 @@ NOTE: The `--network` flag tells Docker to attach our guide container to the exi
94
96
You can find more information in the https://docs.docker.com/network/#container-networks[Docker documentation^].
95
97
endif::[]
96
98
99
+
ifndef::omit_native_build[]
97
100
=== Native Image Support
98
101
99
102
Spring Boot also supports https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html#native-image.introducing-graalvm-native-images[compilation to a native image^], provided you have a GraalVM distribution on your machine.
@@ -106,10 +109,6 @@ plugins {
106
109
----
107
110
endif::[]
108
111
109
-
ifdef::custom_hint_include_file[]
110
-
include::{custom_hint_include_file}
111
-
endif::[]
112
-
113
112
You can then run the `{native_build_command}` command to generate a native image. When the build completes, you will be able to run the code with a near-instantaneous start up time by executing the `{native_run_command}` command.
114
113
115
114
ifeval::["{build_system}" == "maven"]
@@ -124,4 +123,5 @@ endif::[]
124
123
125
124
You can also create a https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html#native-image.developing-your-first-application.buildpacks[Native Image using Buildpacks^]. You can generate a native image by running the `{native_image_build_command}` command. Once the build completes, you can start your application with the `{native_image_run_command}` command.
0 commit comments