Skip to content

Resolve reachability metadata through Maven relocations - #970

Draft
jormundur00 wants to merge 7 commits into
masterfrom
metadata-relocation-fallback-968
Draft

Resolve reachability metadata through Maven relocations#970
jormundur00 wants to merge 7 commits into
masterfrom
metadata-relocation-fallback-968

Conversation

@jormundur00

Copy link
Copy Markdown
Member

Summary

Implements the metadata-lookup side of #968. This is the Native Build Tools counterpart to oracle/graalvm-reachability-metadata#9025.

A dependency may be declared under a pre-relocation Maven coordinate while Gradle or Maven resolves the relocated binary. Metadata generated for the requested coordinate is currently ignored because both plugins query only the selected artifact GAV.

Behavior

For a verified Maven relocation from a requested coordinate to the selected artifact:

  1. Query metadata for the selected/canonical artifact first.
  2. If no configuration is available, query the requested pre-relocation coordinate.
  3. Use only the first non-empty configuration set.
  4. Require an actual Maven relocation POM match; ordinary substitutions and conflict resolution do not activate fallback.

Implementation

  • Gradle retains requested module selectors while traversing the resolution graph and verifies relocation by resolving/parsing the requested POM.
  • Maven compares direct requested artifacts with the selected artifact using Maven Resolver artifact-descriptor relocation data.
  • Shared and plugin-specific metadata-consumption specifications document precedence and non-duplication.

Validation

  • :native-gradle-plugin:compileJava
  • :native-maven-plugin:compileJava
  • :native-gradle-plugin:checkstyleMain
  • :native-maven-plugin:checkstyleMain
  • grund check

All pass with JDK 17.

Draft follow-up

This is a draft while adding end-to-end relocation fixtures for both plugins, including canonical preference, old-coordinate fallback, and non-relocation rejection.

Closes #968

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 9, 2026
@jormundur00 jormundur00 self-assigned this Jul 9, 2026
@jormundur00 jormundur00 added the enhancement New feature or request label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resolve reachability metadata through verified Maven relocations

1 participant