Skip to content

Test-jar type dependencies fail to be resolved during checksum calculation with -f builds #467

@benoitbr

Description

@benoitbr

Affected version

1.2.2, 1.2.1

Bug description

Building a sub-module with mvn -f <submodule> fails when that module depends on a test-jar artifact from another module. The build cache extension's checksum calculation cannot resolve the test-jar dependency, even though the artifact is correctly installed in the local Maven repository.

Full reactor builds are not affected.

Error

[ERROR] Failed to calculate checksums for module-b:
  org.eclipse.aether.resolution.ArtifactResolutionException:
  The following artifacts could not be resolved:
  com.example:module-a:test-jar:1.0.0-SNAPSHOT (absent):
  Could not find artifact com.example:module-a:test-jar:1.0.0-SNAPSHOT

Steps to reproduce

Minimal reproducer project: cache-testjar-reproducer.zip

# 1. Full reactor build — succeeds
mvn clean install

# 2. Build only module-b with -f — FAILS
mvn -f module-b clean install

# 3. Disabling the cache proves the extension is the culprit
mvn -f module-b clean install -Dmaven.build.cache.enabled=false  # succeeds

Environment

  • Maven: 3.9.14

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions