Skip to content

native-maven-plugin does not provide environment variables to the image builder #818

@jormundur00

Description

@jormundur00

Describe the bug
The environment tag of the native-maven-plugin only provides environment variables to the produced binary, but doesn't provide these variables to the image builder.

To Reproduce

Add environment variables to the pom.xml with:

<configuration>
    <environment>
        <variable1>value1</variable1>
        <envVariable2>value2</envVariable2>
    </environment>
</configuration>

then proceed to create an image where System.getenv() is printed/logged in a static initializer. The environment variables provided through the tag are not visible and don't get printed during the image build.

Expected behavior
The environment variables provided through the <environment> tag SHOULD be visible during the image build.

System Info (please complete the following information):

  • OS: [e.g. Linux Ubuntu-22.04]
  • GraalVM Version [e.g. 25.0.1 EE]
  • Java Version [e.g. 17]
  • Plugin version [e.g. native-maven-plugin:0.11.4]

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriorityThis issue needs to be treated with higher priority.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions