Skip to content

Maven cache doesn't save certain dependencies #970

@stechio

Description

@stechio

Description:
I have two build workflows, one for push events (build.yml) and another for daily snapshot publishing (build-nightly.yml).

They use setup-java in the same way: two invocations each workflow, one for build JDK (code compilation) and another for tool JDK (Maven execution). Both build.yml and build-nightly.yml use JDK 17 for build JDK and tool JDK (build.yml uses also version 21 and 25 for build JDK via matrix), but the behavior of their Maven caching diverges: whilst build.yml restores the full state of previous run, build-nightly.yml keeps downloading certain dependencies (presumably publishing-specific) over and over.

Looking at the logs, the JDK setups and post-setups apparently seem identical... I have no clue what's actually going on.

NOTE: The fact build JDK and tool JDK use the same version (17) is purely incidental; I want to keep them distinct in order to smoothly adapt to future changes — originally build JDK used version 11, then it moved to 17.

Task version:
v5

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:

Expected behavior:
The Maven cache for build-nightly.yml should restore the full state of previous run, in order to avoid repetitive dependency downloads.

Actual behavior:
The Maven cache for build-nightly.yml keeps downloading certain dependencies (presumably publishing-specific) over and over.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions