Skip to content

native-maven-plugin lacks runtimeArgs configuration item similar to native-gradle-plugin #685

Open
@linghengqian

Description

@linghengqian

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Please make sure that you are using the latest plugin version, and that similar feature hasn't been requested before.

  • native-maven-plugin lacks runtimeArgs configuration item similar to native-gradle-plugin.
  • Since [GR-52314] Make MissingRegistrationReportingMode a runtime option oracle/graal#8473 was merged into GraalVM CE For JDK 23, the native-maven-plugin can no longer use the -XX:MissingRegistrationReportingMode=Warn parameter for the test maven goal.
  • For native-gradle-plugin, there is a mechanism to dynamically add parameters to the final GraalVM Native Image used by nativeTest.
        ListProperty<String> runtimeArgs = testExtension.getRuntimeArgs();
        runtimeArgs.add("--xml-output-dir");
        runtimeArgs.add(project.getLayout().getBuildDirectory().dir("test-results/" + binaryName + "-native").map(d -> d.getAsFile().getAbsolutePath()));
            List<String> command = new ArrayList<>();
            command.add("--xml-output-dir");
            command.add(xmlLocation.toString());
            systemProperties.forEach((key, value) -> command.add("-D" + key + "=" + value));
            processBuilder.command().addAll(command);
            processBuilder.environment().putAll(environment);

            String commandString = String.join(" ", processBuilder.command());

Describe the solution you'd like
A clear and concise description of what you want to happen.

  • Add runtimeArgs configuration item similar to native-gradle-plugin to native-maven-plugin.
          <profile>
            <id>nativeTestInElasticSearchServer</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.graalvm.buildtools</groupId>
                            <artifactId>native-maven-plugin</artifactId>
                            <version>0.10.4</version>
                            <extensions>true</extensions>
                            <configuration>
                                <buildArgs>
                                    <buildArg>-H:+UnlockExperimentalVMOptions</buildArg>
                                    <buildArg>-H:ThrowMissingRegistrationErrors=</buildArg>
                                </buildArgs>
                                <runtimeArgs>
                                    <runtimeArg>-XX:MissingRegistrationReportingMode=Warn</runtimeArg>
                                </runtimeArgs>
                                <quickBuild>true</quickBuild>
                            </configuration>
                            <executions>
                                <execution>
                                    <id>test-native</id>
                                    <goals>
                                        <goal>test</goal>
                                    </goals>
                                    <phase>test</phase>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

  • Null.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions