Skip to content

Document skipNativeBuildForPom for Maven aggregators#921

Merged
jormundur00 merged 2 commits into
graalvm:masterfrom
jormundur00:rhei/issue-920
Jul 15, 2026
Merged

Document skipNativeBuildForPom for Maven aggregators#921
jormundur00 merged 2 commits into
graalvm:masterfrom
jormundur00:rhei/issue-920

Conversation

@jormundur00

@jormundur00 jormundur00 commented Jun 9, 2026

Copy link
Copy Markdown
Member

Fixes #920

What changed

This PR documents <skipNativeBuildForPom> for Maven aggregator projects.

Before this change, the Maven docs did not clearly explain that skipNativeBuildForPom skips native image generation only for projects with pom packaging 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 for pom packaging while still leaving the actual native build to the module that owns the main class.

Implementation summary

  • Document <skipNativeBuildForPom> next to <skipNativeBuild> in the Maven plugin docs.
  • Explain that it skips native image generation only for Maven projects with pom packaging.
  • Document the default false value for compatibility.
  • Cover the multi-module parent aggregator use case and clarify that users still need to run or configure the native build in the application-owning module.

Validation

  • grund check
  • grund fmt . --marker --check
  • git diff --check
  • JAVA_HOME=/home/jovan/.sdkman/candidates/java/17.0.12-graal ./gradlew :docs:asciidoctor --rerun-tasks

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jun 9, 2026
@jormundur00
jormundur00 marked this pull request as ready for review July 2, 2026 10:48
<skipNativeBuild>true</skipNativeBuild>
----
`<skipNativeBuildForPom>`::
To skip generation of the native image only for Maven projects with `pom` packaging, use

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we infer this from the project?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jormundur00
jormundur00 merged commit 85f91d6 into graalvm:master Jul 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement. rhei

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document skipNativeBuildForPom for Maven multi-module aggregator projects

2 participants