Document skipNativeBuildForPom for Maven aggregators#921
Conversation
34204ab to
80fedb9
Compare
80fedb9 to
9fdd9eb
Compare
| <skipNativeBuild>true</skipNativeBuild> | ||
| ---- | ||
| `<skipNativeBuildForPom>`:: | ||
| To skip generation of the native image only for Maven projects with `pom` packaging, use |
There was a problem hiding this comment.
Can we infer this from the project?
There was a problem hiding this comment.
The plugin already infers pom packaging when this option is enabled. We keep it opt-in because packaging alone does not tell us whether a project is intended to build a native image: a POM project can still provide an explicit classpath and main class.
Without this option, users need to avoid inheriting the native execution into the aggregator—for example, put it separately in every application module, or keep configuration in pluginManagement and add executions in each leaf. That is more verbose and easier to misconfigure in a larger reactor.
skipNativeBuildForPom is therefore a convenience for shared native-plugin configuration: it skips the aggregator execution while application modules continue to build normally.
Fixes #920
What changed
This PR documents
<skipNativeBuildForPom>for Maven aggregator projects.Before this change, the Maven docs did not clearly explain that
skipNativeBuildForPomskips native image generation only for projects withpompackaging while still allowing one native profile to be shared across aggregator and leaf modules.After this change, the docs explain the option, its default value, and the multi-module aggregator use case.
Why
This makes it easier to configure multi-module Maven builds where the aggregator project should not attempt native image generation, but application modules still should.
Example
Before:
Users configuring one native profile across a parent aggregator POM and application modules had to infer how to prevent the aggregator itself from trying to build a native image.
After:
The docs now show that
<skipNativeBuildForPom>can be enabled forpompackaging while still leaving the actual native build to the module that owns the main class.Implementation summary
<skipNativeBuildForPom>next to<skipNativeBuild>in the Maven plugin docs.pompackaging.falsevalue for compatibility.Validation
grund checkgrund fmt . --marker --checkgit diff --checkJAVA_HOME=/home/jovan/.sdkman/candidates/java/17.0.12-graal ./gradlew :docs:asciidoctor --rerun-tasks