What changed
The Maven plugin guide now explains how to include classpath resources in a native image, including resource patterns, automatic resource detection, and the required goal order.
Why
Previously, the Maven guide did not cover this workflow, leaving users to discover the correct configuration and execution order from samples or issue comments. The documented sequence ensures generated resource metadata is available to the native build. Fixes #180.
Example
<goals>
<goal>generateResourceConfig</goal>
<goal>compile-no-fork</goal>
</goals>
<configuration>
<resourceIncludedPatterns>
<pattern>application.properties</pattern>
</resourceIncludedPatterns>
</configuration>
Running ./mvnw -Pnative -Dresources.autodetection.enabled=true package enables automatic resource detection. Generated metadata is written to target/native/generated/generateResourceConfig/resource-config.json and consumed by the following native build goal.
Implementation summary
Added a Maven Resources section with the supported nested pattern syntax, a package-phase execution that generates resource metadata before the native image, the generated file location, and the autodetection command.
Validation
git diff --check
grund check
grund fmt . --marker --cross-refs --check
- Compared the example with
samples/java-application-with-resources/pom.xml and native-maven-plugin/src/functionalTest/groovy/org/graalvm/buildtools/maven/JavaApplicationWithResourcesFunctionalTest.groovy.
- Attempted
./gradlew :docs:tasks --all, ./gradlew :docs:asciidoctor --dry-run, and ./gradlew --no-daemon :docs:asciidoctor --stacktrace; each stalled during Gradle startup before task execution, so a local documentation render result is not available.