Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ public abstract class AbstractNativeImageMojo extends AbstractNativeMojo {
@Parameter(property = "excludeConfig")
protected List<ExcludeConfigConfiguration> excludeConfig;

@Parameter(property = "environmentVariables")
@Parameter(alias = "environmentVariables", property = "environmentVariables")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this for bundles?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tag represents a way to set env variables through the pom.xml (like it's done in the surefire/failsafe plugins), without having to provide them in the CLI or through other <buildArgs> -E<..>=<..> pom tags.

The alias was added to stay consistent with other plugins that use this feature (and our documentation) while not breaking older builds that used the <environment> tag.

protected Map<String, String> environment;

@Parameter(property = "systemPropertyVariables")
@Parameter(alias = "systemPropertyVariables", property = "systemPropertyVariables")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this even documented? Why not just -D?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, the documentation states that the <systemPropertyVariables> tag should be used to set system properties from the pom.xml. Internally, this tag gets mapped as if the user has been using -D from the command line:

if (systemProperties != null) {
    for (Map.Entry<String, String> entry : systemProperties.entrySet()) {
        cliArgs.add("-D" + entry.getKey() + "=" + entry.getValue());
    }
}

protected Map<String, String> systemProperties;

@Parameter(property = "configurationFileDirectories")
Expand Down Expand Up @@ -243,6 +243,12 @@ protected List<String> getBuildArgs() throws MojoExecutionException {
}
}

if (environment != null) {
for (Map.Entry<String, String> entry : environment.entrySet()) {
cliArgs.add("-E" + entry.getKey() + "=" + entry.getValue());
}
}

if (jvmArgs != null) {
jvmArgs.forEach(jvmArg -> cliArgs.add("-J" + jvmArg));
}
Expand Down
Loading