-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NativeImageMojo: Make additionalBuildArgs
not override quarkus.native.additional-build-args
property
#12666
Comments
I don't think it's worth doing anything about it given |
Uh interesting, I was not aware of that. So moving forward only In that case shall I open a PR replacing the use of BTW there is still a loose reference to @Karm FYI (you are using additionalBuildArgs in https://github.com/Karm/mandrel-integration-tests/blob/1c62a14d9f55e04eda78627037ccfb1b96553f2d/apps/quarkus-full-microprofile/pom.xml) |
exactly |
Or at least make the maven plugin print a warning that this is deprecated, it overrides |
I don't know if that is possible, but if it is, then it would surely make sense |
I think this should do it: diff --git a/devtools/maven/src/main/java/io/quarkus/maven/NativeImageMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/NativeImageMojo.java
index c3203c09ca..e3706f1391 100644
--- a/devtools/maven/src/main/java/io/quarkus/maven/NativeImageMojo.java
+++ b/devtools/maven/src/main/java/io/quarkus/maven/NativeImageMojo.java
@@ -316,6 +316,9 @@ public class NativeImageMojo extends AbstractMojo {
configs.put("quarkus.native.add-all-charsets", addAllCharsets.toString());
}
if (additionalBuildArgs != null && !additionalBuildArgs.isEmpty()) {
+ getLog().warn("Your application is setting the deprecated 'additionalBuildArgs' Maven option."
+ + " This option overrides any value passed to the quarkus.native.additional-build-args"
+ + " property and will be removed in the future");
configs.put("quarkus.native.additional-build-args",
additionalBuildArgs.stream()
.map(val -> val.replace("\\", "\\\\")) Output:
I'll prepare a PR. |
Description
When debugging a native-image
-Dquarkus.native.additional-build-args
can be very handy, since it allows the users to pass various flags tonative-image
.For instance,
-Dquarkus.native.additional-build-args='-H:Log=dwarf.*:3,-Dgraal.LogFile=log.txt'
will enable verbose logging for dwarf symbols generation and store the output inlog.txt
.However, in the case where the pom file of the application at hand already contains a non empty
additionalBuildArgs
entry in its configuration anything passed toquarkus.native.additional-build-args
will be ignored.For example
./mvnw clean compile package -Dquarkus.native.additional-build-args='-H:Log=dwarf.debug_lines:3,-Dgraal.LogFile=lineslog.out' -Dnative -pl integration-tests/rest-client
does not pass-H:Log=dwarf.debug_lines:3,-Dgraal.LogFile=lineslog.out
tonative-image
as shown in the log below:Implementation ideas
The override of the
quarkus.native.additional-build-args
property byadditionalBuildArgs
happens inquarkus/devtools/maven/src/main/java/io/quarkus/maven/NativeImageMojo.java
Lines 268 to 273 in 9d5f822
Depending on how we want to handle this we can change
quarkus/devtools/maven/src/main/java/io/quarkus/maven/NativeImageMojo.java
Lines 318 to 324 in 9d5f822
quarkus.native.additional-build-args
is already defined and either ignoreadditionalBuildArgs
(reverse behavior) or combineadditionalBuildArgs
with the existingquarkus.native.additional-build-args
The text was updated successfully, but these errors were encountered: