-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add maven support for agent #343
Add maven support for agent #343
Conversation
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 is a good start, but it needs quite some more work. Specially, you need to write tests.
native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/MetadataCopyMojo.java
Outdated
Show resolved
Hide resolved
native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/MetadataCopyMojo.java
Outdated
Show resolved
Hide resolved
native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeExtension.java
Outdated
Show resolved
Hide resolved
...aven-plugin/src/main/java/org/graalvm/buildtools/maven/config/MetadataCopyConfiguration.java
Outdated
Show resolved
Hide resolved
...aven-plugin/src/main/java/org/graalvm/buildtools/maven/config/MetadataCopyConfiguration.java
Outdated
Show resolved
Hide resolved
native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/MetadataCopyMojo.java
Outdated
Show resolved
Hide resolved
...aven-plugin/src/main/java/org/graalvm/buildtools/maven/config/MetadataCopyConfiguration.java
Outdated
Show resolved
Hide resolved
native-maven-plugin/src/main/java/org/graalvm/buildtools/utils/AgentUtils.java
Outdated
Show resolved
Hide resolved
native-maven-plugin/src/main/java/org/graalvm/buildtools/utils/Utils.java
Outdated
Show resolved
Hide resolved
...en-plugin/src/main/java/org/graalvm/buildtools/maven/config/AbstractMergeAgentFilesMojo.java
Show resolved
Hide resolved
7dae693
to
6f16252
Compare
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.
Besides the inline comments, documentation is missing
common/utils/src/main/java/org/graalvm/buildtools/agent/AgentConfiguration.java
Outdated
Show resolved
Hide resolved
...tionalTest/groovy/org/graalvm/buildtools/maven/JavaApplicationWithAgentFunctionalTest.groovy
Outdated
Show resolved
Hide resolved
...tionalTest/groovy/org/graalvm/buildtools/maven/JavaApplicationWithAgentFunctionalTest.groovy
Outdated
Show resolved
Hide resolved
...tionalTest/groovy/org/graalvm/buildtools/maven/JavaApplicationWithAgentFunctionalTest.groovy
Outdated
Show resolved
Hide resolved
native-maven-plugin/src/main/java/org/graalvm/buildtools/utils/Xpp3DomParser.java
Show resolved
Hide resolved
9a98234
to
977c8ab
Compare
Style issues will be fixed once main logic gets approval. |
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.
Please provide feedback on this first set of questions, thanks!
native-maven-plugin/src/main/java/org/graalvm/buildtools/utils/AgentUtils.java
Show resolved
Hide resolved
...e-maven-plugin/src/main/java/org/graalvm/buildtools/utils/NativeImageConfigurationUtils.java
Show resolved
Hide resolved
native-maven-plugin/src/main/java/org/graalvm/buildtools/utils/Utils.java
Outdated
Show resolved
Hide resolved
...ven-plugin/src/testFixtures/groovy/org/graalvm/buildtools/maven/IsolatedMavenExecutor.groovy
Show resolved
Hide resolved
native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/AbstractNativeImageMojo.java
Outdated
Show resolved
Hide resolved
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.
I tested it with a simple Spring Boot generated on start.spring.io, the project only has the default:
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
</plugin>
When running mvn clean package
it throw the following exception:
[ERROR] Internal error: java.lang.NullPointerException: Cannot invoke "org.codehaus.plexus.util.xml.Xpp3Dom.getName()" because "root" is null -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException: Cannot invoke "org.codehaus.plexus.util.xml.Xpp3Dom.getName()" because "root" is null
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.NullPointerException: Cannot invoke "org.codehaus.plexus.util.xml.Xpp3Dom.getName()" because "root" is null
at org.graalvm.buildtools.utils.Xpp3DomParser.getTagByName (Xpp3DomParser.java:52)
at org.graalvm.buildtools.utils.AgentUtils.collectAgentProperties (AgentUtils.java:123)
at org.graalvm.buildtools.maven.NativeExtension.lambda$afterProjectsRead$5 (NativeExtension.java:130)
at java.util.Optional.ifPresent (Optional.java:178)
at org.graalvm.buildtools.maven.NativeExtension.withPlugin (NativeExtension.java:201)
I then checked the CI run of the latest commit, but looks like checkstyle did not pass:
https://github.com/graalvm/native-build-tools/actions/runs/3688052159/jobs/6242397017
Please fix those issues and ensure your changes are properly tested.
fcc6bb9
to
a0351fd
Compare
When configuring: <configuration>
<agent>
<enabled>true</enabled>
</agent>
</configuration> I see the following error:
Like the other parts of the plugin, I think it is important that it works without making |
I agree with this idea. The only thing I am thinking about is should I do that inside this PR or I should create separate PR. It looks like this is commonly used in many parts of the repo and not only related to the agent. What is your opinion? |
Pro-tip: do not mix concerns in a single PR. Smaller, focused PRs are easier to review by peers and more likely to be merged quickly. |
If this is not a regression introduced by that PR, we could probably fix it in another PR but IMO we should do that before releasing NBT |
I tested plugin with |
|
No description provided.