Skip to content

Commit a72abac

Browse files
authored
Merge pull request #34256 from gsmet/native-consistency
Use -Dnative consistently as it is what we recommend
2 parents 9fa8a84 + 0b8a4f0 commit a72abac

11 files changed

+26
-24
lines changed

docs/src/main/asciidoc/amazon-lambda.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ sh target/manage.sh update
229229
== Deploy to AWS Lambda Custom (native) Runtime
230230

231231
If you want a lower memory footprint and faster initialization times for your lambda, you can compile your Java
232-
code to a native executable. Just make sure to rebuild your project with the `-Pnative` switch.
232+
code to a native executable. Just make sure to rebuild your project with the `-Dnative` switch.
233233

234234
For Linux hosts, execute:
235235

docs/src/main/asciidoc/amqp.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,8 @@ To run your applications as native, first we need to build the native executable
429429

430430
[source, bash]
431431
----
432-
> mvn -f amqp-quickstart-producer package -Pnative -Dquarkus.native.container-build=true
433-
> mvn -f amqp-quickstart-processor package -Pnative -Dquarkus.native.container-build=true
432+
> mvn -f amqp-quickstart-producer package -Dnative -Dquarkus.native.container-build=true
433+
> mvn -f amqp-quickstart-processor package -Dnative -Dquarkus.native.container-build=true
434434
----
435435

436436
The `-Dquarkus.native.container-build=true` instructs Quarkus to build Linux 64bits native executables, who can run inside containers.

docs/src/main/asciidoc/building-native-image.adoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,13 @@ include::{includes}/devtools/build-native.adoc[]
214214
====
215215
The Microsoft Native Tools for Visual Studio must first be initialized before packaging. You can do this by starting
216216
the `x64 Native Tools Command Prompt` that was installed with the Visual Studio Build Tools. At
217-
`x64 Native Tools Command Prompt` you can navigate to your project folder and run `mvnw package -Pnative`.
217+
`x64 Native Tools Command Prompt` you can navigate to your project folder and run `mvnw package -Dnative`.
218218
219219
Another solution is to write a script to do this for you:
220220
221221
[source,bash]
222222
----
223-
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat" && mvn package -Pnative'
223+
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat" && mvn package -Dnative'
224224
----
225225
====
226226

@@ -249,10 +249,10 @@ Compiling fully static binaries is done by statically linking https://musl.libc.
249249

250250
Producing a native executable can lead to a few issues, and so it's also a good idea to run some tests against the application running in the native file. The reasoning is explained in the link:getting-started-testing#quarkus-integration-test[Testing Guide].
251251

252-
To see the `GreetingResourceIT` run against the native executable, use `./mvnw verify -Pnative`:
252+
To see the `GreetingResourceIT` run against the native executable, use `./mvnw verify -Dnative`:
253253
[source,shell,subs=attributes+]
254254
----
255-
$ ./mvnw verify -Pnative
255+
$ ./mvnw verify -Dnative
256256
...
257257
Finished generating 'getting-started-1.0.0-SNAPSHOT-runner' in 22.0s.
258258
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] docker run --env LANG=C --rm --user 1000:1000 -v /home/zakkak/code/quarkus-quickstarts/getting-started/target/getting-started-1.0.0-SNAPSHOT-native-image-source-jar:/project:z --entrypoint /bin/bash quay.io/quarkus/ubi-quarkus-mandrel-builder-image:{mandrel-flavor} -c objcopy --strip-debug getting-started-1.0.0-SNAPSHOT-runner
@@ -281,7 +281,7 @@ __ ____ __ _____ ___ __ ____ ______
281281
====
282282
By default, Quarkus waits for 60 seconds for the native image to start before automatically failing the native tests. This
283283
duration can be changed using the `quarkus.test.wait-time` system property. For example, to increase the duration
284-
to 300 seconds, use: `./mvnw verify -Pnative -Dquarkus.test.wait-time=300`.
284+
to 300 seconds, use: `./mvnw verify -Dnative -Dquarkus.test.wait-time=300`.
285285
====
286286

287287
[WARNING]
@@ -295,12 +295,12 @@ By default, integration tests both *build* and *run* the native executable using
295295

296296
You can override the profile the executable *runs* with during the test using the `quarkus.test.native-image-profile` property.
297297
Either by adding it to `application.properties` or by appending it to the command line:
298-
`./mvnw verify -Pnative -Dquarkus.test.native-image-profile=test`.
298+
`./mvnw verify -Dnative -Dquarkus.test.native-image-profile=test`.
299299
Your `%test.` prefixed properties will be used at the test runtime.
300300

301301

302302
You can override the profile the executable is *built* with and *runs* with using the `quarkus-profile=test` property, e.g.
303-
`./mvnw clean verify -Pnative -Dquarkus-profile=test`. This might come handy if there are test specific resources to be processed,
303+
`./mvnw clean verify -Dnative -Dquarkus-profile=test`. This might come handy if there are test specific resources to be processed,
304304
such as importing test data into the database.
305305

306306
[source,properties]
@@ -378,7 +378,7 @@ testing the application in JVM mode, in a container image, and native image.
378378
=== Testing an existing native executable
379379

380380
It is also possible to re-run the tests against a native executable that has already been built. To do this run
381-
`./mvnw test-compile failsafe:integration-test -Pnative`. This will discover the existing native image and run the tests against it using failsafe.
381+
`./mvnw test-compile failsafe:integration-test -Dnative`. This will discover the existing native image and run the tests against it using failsafe.
382382

383383
If the process cannot find the native image for some reason, or you want to test a native image that is no longer in the
384384
target directory you can specify the executable with the `-Dnative.image.path=` system property.
@@ -458,7 +458,7 @@ If one of those extensions is present, then creating a container image for the n
458458

459459
[source,bash]
460460
----
461-
./mvnw package -Pnative -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true
461+
./mvnw package -Dnative -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true
462462
----
463463

464464
* `quarkus.native.container-build=true` allows for creating a Linux executable without GraalVM being installed (and is only necessary if you don't have GraalVM installed locally or your local operating system is not Linux)
@@ -579,7 +579,7 @@ USER quarkus
579579
WORKDIR /code
580580
RUN ./mvnw -B org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline
581581
COPY src /code/src
582-
RUN ./mvnw package -Pnative
582+
RUN ./mvnw package -Dnative
583583
584584
## Stage 2 : create the docker final image
585585
FROM quay.io/quarkus/quarkus-micro-image:2.0
@@ -714,7 +714,7 @@ USER quarkus
714714
WORKDIR /code
715715
RUN ./mvnw -B org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline
716716
COPY src /code/src
717-
RUN ./mvnw package -Pnative -DskipTests -Dquarkus.native.additional-build-args="--static","--libc=musl"
717+
RUN ./mvnw package -Dnative -DskipTests -Dquarkus.native.additional-build-args="--static","--libc=musl"
718718
719719
## Stage 2 : create the final image
720720
FROM scratch
@@ -737,7 +737,7 @@ More details on xref:./upx.adoc[UPX Compression documentation].
737737
In certain circumstances, you may want to build the native image in a separate step.
738738
For example, in a CI/CD pipeline, you may want to have one step to generate the source that will be used for the native image generation and another step to use these sources to actually build the native executable.
739739
For this use case, you can set the `quarkus.package.type=native-sources`.
740-
This will execute the java compilation as if you had started native compilation (`-Pnative`), but stops before triggering the actual call to GraalVM's `native-image`.
740+
This will execute the java compilation as if you had started native compilation (`-Dnative`), but stops before triggering the actual call to GraalVM's `native-image`.
741741

742742
[source,bash]
743743
----

docs/src/main/asciidoc/config-reference.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ The default Quarkus runtime profile is set to the profile used to build the appl
452452

453453
[source,bash]
454454
----
455-
./mvnw package -Pnative -Dquarkus.profile=prod-aws
455+
./mvnw package -Dnative -Dquarkus.profile=prod-aws
456456
./target/my-app-1.0-runner // <1>
457457
----
458458
<1> The command will run with the `prod-aws` profile. This can be overridden using the `quarkus.profile` configuration.

docs/src/main/asciidoc/deploying-to-heroku.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ mvn clean package\
198198
-Dquarkus.container-image.group=registry.heroku.com/$APP_NAME\
199199
-Dquarkus.container-image.name=web\
200200
-Dquarkus.container-image.tag=latest\
201-
-Pnative\
201+
-Dnative\
202202
-Dquarkus.native.container-build=true
203203
----
204204

docs/src/main/asciidoc/funqy-amazon-lambda.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ sh target/manage.sh update
184184
== Deploy to AWS Lambda Custom (native) Runtime
185185

186186
If you want a lower memory footprint and faster initialization times for your Funqy function, you can compile your Java
187-
code to a native executable. Just make sure to rebuild your project with the `-Pnative` switch.
187+
code to a native executable. Just make sure to rebuild your project with the `-Dnative` switch.
188188

189189
For Linux hosts execute:
190190

docs/src/main/asciidoc/grpc-getting-started.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ Then, open http://localhost:8080/hello/quarkus in a browser, and you should get
368368
== Packaging the application
369369

370370
Like any other Quarkus applications, you can package it with: `mvn package`.
371-
You can also package the application into a native executable with: `mvn package -Pnative`.
371+
You can also package the application into a native executable with: `mvn package -Dnative`.
372372

373373
[[protobuf-maven-plugin]]
374374
== Generating Java files from proto with protobuf-maven-plugin

docs/src/main/asciidoc/hibernate-search-orm-elasticsearch.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,9 @@ SearchMapping searchMapping;
801801

802802
== Building a native executable
803803

804-
You can build a native executable with the usual command `./mvnw package -Pnative`.
804+
You can build a native executable with the usual command:
805+
806+
include::{includes}/devtools/build-native.adoc[]
805807

806808
[NOTE]
807809
====

docs/src/main/asciidoc/jreleaser.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ remote resources such as Git repositories. This is how it would look like:
488488
[source,subs=attributes+]
489489
----
490490
# because we changed the project's version
491-
./mvnw -Pnative,dist package
491+
./mvnw -Dnative,dist package
492492
./mvnw -Prelease jreleaser:full-release -Djreleaser.select.current.platform -Djreleaser.dry.run=true
493493
494494
[INFO] --- jreleaser-maven-plugin:{jreleaser-version}:full-release (default-cli) @ app ---

docs/src/main/asciidoc/maven-tooling.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ To run Integration Tests on the native executable, make sure to have the proper
407407

408408
[source,shell]
409409
----
410-
$ ./mvnw verify -Pnative
410+
$ ./mvnw verify -Dnative
411411
...
412412
[quarkus-quickstart-runner:50955] universe: 391.96 ms
413413
[quarkus-quickstart-runner:50955] (parse): 904.37 ms

0 commit comments

Comments
 (0)