Skip to content
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

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

Open
linghengqian opened this issue Jan 26, 2025 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@linghengqian
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants