-
Notifications
You must be signed in to change notification settings - Fork 76
Add runtimeArgs
support to native-maven-plugin
#734
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
base: master
Are you sure you want to change the base?
Conversation
723580d
to
1453db7
Compare
@@ -204,6 +207,16 @@ private void configureEnvironment() { | |||
systemProperties.put(child.getName(), child.getValue()); | |||
} | |||
} | |||
Xpp3Dom runtimeArguments = dom.getChild("runtimeArgs"); |
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 would read the <runtimeArgs>
configuration tag from the maven-surefire-plugin
definition, which I don't think is what you want to do.
If what you want is Native Build Tool's <runtimeArgs>
, then use the field annotated with @Parameter
.
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.
- In fact, this logic does read parameters from
native-maven-plugin
, and the processing ofmaven-surefire-plugin
is limited to the unit test file, which is a misunderstanding. - And I actually have no way to add unit tests for GraalVM CE For JDK 23 alone. Because as far as I know, spock does not have Junit annotations such as
org.junit.jupiter.api.condition.DisabledForJreRange
.
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 logic does try to read the runtime args from maven-surefire-plugin
, see line 185. The condition at line 211 will never be true.
What happens is that if you set <buildArgs>
in native-build-tools
, then runtimeArgs
will be set by Maven, not by this logic.
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.
- Wow, I just realized that I thought NBT needed to manually get properties from
org.codehaus.plexus.util.xml.Xpp3Dom
at this point, which I have removed in the latest commit.
@@ -204,6 +207,16 @@ private void configureEnvironment() { | |||
systemProperties.put(child.getName(), child.getValue()); | |||
} | |||
} | |||
Xpp3Dom runtimeArguments = dom.getChild("runtimeArgs"); |
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 logic does try to read the runtime args from maven-surefire-plugin
, see line 185. The condition at line 211 will never be true.
What happens is that if you set <buildArgs>
in native-build-tools
, then runtimeArgs
will be set by Maven, not by this logic.
With regards to testing this with Spock, you can use |
|
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.
@dnestoro please help @linghengqian to write a test for this. The one added here is still skipped.
Other than that, this LGTM
@linghengqian thank you for your patience and collaboration!
@@ -5,6 +5,10 @@ | |||
|
|||
This version introduces a breaking change: the plugin now requires Java 17 to run. | |||
|
|||
=== Maven plugin |
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.
@dnestoro will this go into 0.11.0? If not, please adjust it
native-maven-plugin
lacksruntimeArgs
configuration item similar tonative-gradle-plugin
#685 .native-maven-plugin
cannot publish to local repository on Windows with Simplified Chinese #735 .runtimeArgs
support tonative-maven-plugin
.native-maven-plugin
to local repository on Windows with Simplified Chinese../gradlew publishToMavenLocal --no-parallel
against https://github.com/linghengqian/jetcd-multi-platform-native-test andorg.graalvm.buildtools:native-maven-plugin:0.11.0-SNAPSHOT
. This even fixes the bug reported in [Native Image] Netty DNS Resolver is not available in GraalVM Native Image compiled on Windows oracle/graal#11280 where the unit tests never stopped.