-
Notifications
You must be signed in to change notification settings - Fork 84
Make environment variables set in the pom.xml of the native-maven-plugin be visible in the image builder #819
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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") | ||
| protected Map<String, String> environment; | ||
|
|
||
| @Parameter(property = "systemPropertyVariables") | ||
| @Parameter(alias = "systemPropertyVariables", property = "systemPropertyVariables") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this even documented? Why not just
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently, the documentation states that the |
||
| protected Map<String, String> systemProperties; | ||
|
|
||
| @Parameter(property = "configurationFileDirectories") | ||
|
|
@@ -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)); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 thesurefire/failsafeplugins), 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.