Skip to content

Handle Maven artifact relocations during metadata and stats finalization #9024

Description

@jormundur00

Problem

The automation finalization path fails for Maven coordinates that are relocation POMs rather than binary JARs. For io.github.pdvrieze.xmlutil:core-jvmcommon:1.0.0 (tracked in #8848), normal Gradle test dependency resolution follows the relocation to core-jvm:1.0.0, but the metadata-generation fromJar resolver requests a non-transitive JAR for the original coordinate and receives no JAR. This causes generateMetadata to fail with Failed to resolve JAR for io.github.pdvrieze.xmlutil:core-jvmcommon:1.0.0.

The same mismatch affects generateLibraryStats: its tested-library JAR lookup searches resolved artifacts using the requested artifact coordinates and cannot identify the relocated binary. Consequently finalization stops before stats are generated, even though compilation and tests can pass.

Expected behavior

Metadata generation with --agentAllowedPackages=fromJar, dynamic-access tracking, listLibraryJars, and generateLibraryStats should follow Maven relocation metadata to the actual binary artifact. Ordinary non-relocated artifacts must retain the existing behavior and transitive dependencies must not be included.

Related occurrence

  • #8848io.github.pdvrieze.xmlutil:core-jvmcommon:1.0.0

Validation

The fix should be validated with the relocated example, including metadata generation, -H:TrackDynamicAccess using the relocated JAR path, stats generation, and the complete targeted test with JDK 25/GraalVM.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions