JiriOndrusek commented on issue #8064:
URL: https://github.com/apache/camel-quarkus/issues/8064#issuecomment-3768459276

   I checked the differences between `-pnative` and `-dnative`.
   
   * **-Dnative** is the correct Quarkus way of requesting native build. It 
seems to be a shortcut for `-Dquarkus.package.type=native`. Parameter triggers 
the native build.
   
   * **-Pnative** is CQ's (maven) profile for triggering the native build. 
Having profile and using `-Pnative` allows us for example to disable native 
build by removing the profile. 
   
   I found a statement in one of the top [Quarkus 
guides](https://quarkus.io/guides/building-native-image) (about native build):
   ```
   We use a profile because, you will see very soon, packaging the native 
executable takes a few minutes. 
   You could just pass -Dquarkus.native.enabled=true as a property on the 
command line, however it is better to use a profile as this allows native image 
tests to also be run.
   ```
   
   With the fact, that 
   * we provide `native` profiles to all modules (including examples)
   * profile defines maven plugin for running integration tests
   * Quarkus suggests to use `-Pnative` in order to run native image tests 
correctly
   
   I'd say to keep using `-Pnative` as it is the correct way in our case.
   
   That brings us to:
   * as @gansheer noticed, that the empty generated Quarkus project suggest to 
use `-Dnative` and also contains `native profile`, this is actually correct. 
The `-Dnative` is used only for creation if the native executable build 
(without running tests). The `native` profile seems to be a template for the 
case you are adding integration tests  running with native image.
   * the different places in the camel-quarkus-examples. All 
[occurrences](https://github.com/search?q=repo%3Aapache%2Fcamel-quarkus-examples%20-pnative&type=code)
 of `-Pnative` (except the CI -build.yaml), should be replaced by `-Dnative` -> 
because all the cases describes a way to creative native build (and we should 
be aligned with Quarkus on it)
   
   WDYT @aldettinger , @gansheer , @jamesnetherton   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to