What changed
Plugin-level <skip>true</skip> now stops every native Maven plugin goal before that goal performs work. This includes add-reachability-metadata, so it no longer downloads, copies, or generates reachability metadata when the plugin is skipped.
Why
A root plugin skip previously applied to native build goals but not to metadata retrieval. Builds that intentionally disabled the native Maven plugin could still perform metadata work and leave generated files behind.
Example
With this plugin configuration, a bound add-reachability-metadata execution is skipped along with the other native Maven goals:
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
The Maven output includes Skipping native Maven plugin goal (parameter skip is true)., and no reachability-metadata directory or copied metadata files are created.
Implementation summary
Added one shared skip guard used by the Maven goal hierarchy, moved goal-specific work behind that guard, documented the plugin-wide behavior, and added a real-Maven regression test for the metadata goal.
The inspection follow-up makes the existing AbstractNativeMojo test double implement the new executeInternal() hook instead of overriding the guard’s final execute() method. It also completes the required UPL header on the new shared class and removes the import made unused by the refactor. These changes are required for the test compilation and Checkstyle inspections to pass without weakening the skip guard.
Validation
JAVA_HOME=/home/jovan/.sdkman/candidates/java/17.0.12-graal GRAALVM_HOME=/home/jovan/.sdkman/candidates/java/17.0.12-graal ./gradlew :graalvm-reachability-metadata:publishAllPublicationsToCommonRepository :native-maven-plugin:publishAllPublicationsToCommonRepository :native-maven-plugin:inspections --no-parallel
grund check
grund fmt . --marker --cross-refs --check
git diff --check
Fixes #628