Skip to content

Commit a3bf346

Browse files
committed
Review Maven/Gradle Build Tools NI guides
1 parent 95ba29e commit a3bf346

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

docs/reference-manual/native-image/guides/use-native-image-gradle-plugin.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ permalink: /reference-manual/native-image/guides/use-native-image-gradle-plugin/
88
# Use Gradle to Build a Native Executable from a Java Application
99

1010
You can use the Gradle plugin for GraalVM Native Image to build a native executable from a Java application in one step, in addition to a runnable JAR.
11-
The plugin is provided as part of the [Native Build Tools project](https://graalvm.github.io/native-build-tools/latest/index.html) and uses the [Gradle build tool](https://gradle.org/).
11+
The plugin is provided as part of the [Native Build Tools project](https://graalvm.github.io/native-build-tools/latest/index.html).
1212

13-
The Gradle plugin for GraalVM Native Image works with the `application` plugin and registers a number of tasks and extensions for you. For more information, see the [plugin documentation](https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html).
13+
The Gradle plugin for GraalVM Native Image works with the `application` plugin and registers a number of tasks and extensions for you.
14+
For more information, see the [plugin documentation](https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html).
1415

1516
This guide shows you how to use the Native Image Gradle plugin to build a native executable from a Java application, add support for dynamic features, and run JUnit tests.
1617

@@ -26,7 +27,7 @@ We recommend that you follow the instructions and create the application step-by
2627
git clone https://github.com/graalvm/graalvm-demos && cd graalvm-demos/fortune-demo/fortune-gradle
2728
```
2829

29-
> You must have [GraalVM installed with Native Image support](../README.md#install-native-image).
30+
> Note: To use the Native Build Tools, first install GraalVM. The easiest way to install GraalVM is to use the [GraalVM JDK Downloader](https://github.com/graalvm/graalvm-jdk-downloader): `bash <(curl -sL https://get.graalvm.org/jdk)`.
3031
3132
## Prepare a Demo Application
3233

@@ -160,15 +161,15 @@ git clone https://github.com/graalvm/graalvm-demos && cd graalvm-demos/fortune-d
160161
161162
Also, remove the dependency on `guava` that will not be used.
162163
163-
The next steps will be focused what you should do to enable the Native Image Gradle plugin.
164+
The next steps demonstrate what you should do to enable the [Native Image Gradle plugin](https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html).
164165
165166
7. Register the Native Image Gradle plugin. Add the following to `plugins` section of your project’s _build.gradle_ file:
166167
167168
```xml
168169
plugins {
169170
// ...
170171
171-
id 'org.graalvm.buildtools.native' version '0.9.12'
172+
id 'org.graalvm.buildtools.native' version '0.9.18'
172173
}
173174
```
174175
The plugin discovers which JAR files it needs to pass to the `native-image` builder and what the executable main class should be.

docs/reference-manual/native-image/guides/use-native-image-maven-plugin.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ We recommend that you follow the instructions and create the application step-by
2020
git clone https://github.com/graalvm/graalvm-demos && cd graalvm-demos/fortune-demo/fortune
2121
```
2222

23-
> You must have [GraalVM installed with Native Image support](../README.md#install-native-image).
23+
> Note: To use the Native Build Tools, first install GraalVM. The easiest way to install GraalVM is to use the [GraalVM JDK Downloader](https://github.com/graalvm/graalvm-jdk-downloader): `bash <(curl -sL https://get.graalvm.org/jdk)`.
2424
2525
## Prepare a Demo Application
2626

@@ -204,16 +204,16 @@ git clone https://github.com/graalvm/graalvm-demos && cd graalvm-demos/fortune-d
204204

205205
```xml
206206
<properties>
207-
<native.maven.plugin.version>0.9.12</native.maven.plugin.version>
207+
<native.maven.plugin.version>0.9.18</native.maven.plugin.version>
208208
<junit.jupiter.version>5.8.1</junit.jupiter.version>
209209
<maven.compiler.source>${java.specification.version}</maven.compiler.source>
210210
<maven.compiler.target>${java.specification.version}</maven.compiler.target>
211211
<imageName>fortune</imageName>
212212
<mainClass>demo.Fortune</mainClass>
213213
</properties>
214214
```
215-
The statements "hardcoded" plugin versions and the entry point class to your application.
216-
The next steps will show you how enable the Maven plugin for GraalVM Native Image.
215+
The statements "hardcoded" plugin versions and the entry point class to your application.
216+
The next steps demonstrate what you should do to enable the [Native Image Maven plugin](https://graalvm.github.io/native-build-tools/latest/maven-plugin.html).
217217

218218
6. Register the Maven plugin for GraalVM Native Image, `native-maven-plugin`, in the profile called `native` by adding the following to the _pom.xml_ file:
219219
```xml
@@ -263,7 +263,7 @@ git clone https://github.com/graalvm/graalvm-demos && cd graalvm-demos/fortune-d
263263
```
264264
The plugin discovers which JAR files it needs to pass to the `native-image` builder and what the executable main class should be. With this plugin you can already build a native executable directly with Maven by running `mvn -Pnative package` (if your application does not call any methods reflectively at run time).
265265

266-
This demo application is a little more complicated than `HelloWorld`, and and [requires metadata](../ReachabilityMetadata.md) before building a native executable. You do not have to configure anything manually: the Native Image Maven plugin can generate the required metadata for you by injecting the [Java agent](https://graalvm.github.io/native-build-tools/latest/maven-plugin.html#agent-support) at package time. The agent is disabled by default, and can be enabled in project's _pom.xml_ file or via the command line.
266+
This demo application is a little more complicated than `HelloWorld`, and [requires metadata](../ReachabilityMetadata.md) before building a native executable. You do not have to configure anything manually: the Native Image Maven plugin can generate the required metadata for you by injecting the [Java agent](https://graalvm.github.io/native-build-tools/latest/maven-plugin.html#agent-support) at package time. The agent is disabled by default, and can be enabled in project's _pom.xml_ file or via the command line.
267267
- To enable the agent via the _pom.xml_ file, specify `<enabled>true</enabled>` in the `native-maven-plugin` plugin configuration:
268268

269269
```xml
@@ -336,7 +336,7 @@ git clone https://github.com/graalvm/graalvm-demos && cd graalvm-demos/fortune-d
336336
```
337337
When the command completes a native executable, _fortune_, is created in the _/target_ directory of the project and ready for use.
338338

339-
The executable's name is derived from the artifact ID, but you can specify any custom name in the `native-maven-plugin` plugin within a <configuration> node:
339+
The executable's name is derived from the artifact ID, but you can specify any custom name in `native-maven-plugin` within a `<configuration>` node:
340340
341341
```xml
342342
<configuration>

0 commit comments

Comments
 (0)