Cache Task in AzureDevOps doesn't work

Lazarenko, Sergey 46 Reputation points
2024-02-19T15:24:38.8066667+00:00

Hello Community. We have faced an issue with Cache@2 task in Azure DevOps with very typical config. Here is its content:

- task: Cache@2
  displayName: Cache Maven Repository
  inputs:
    key: 'maven_repositories'
    cacheHitVar: 'true'
    path: $(MAVEN_CACHE_FOLDER)

After that task we have Maven@4 task using

options: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'

and

variables:
- name: MAVEN_CACHE_FOLDER
  value: $(Pipeline.Workspace)/.m2/repository

But, the issue is that while Maven runs, it still downloads all dependencies from Central repository. Any idea, suggestion? Thank you in advance.

Community Center Not monitored
0 comments No comments
{count} votes

Accepted answer
  1. ManoharLakkoju 710 Reputation points Microsoft External Staff Moderator
    2024-02-20T04:32:45.6666667+00:00

    @Lazarenko, Sergey
    Welcome to Microsoft Q&A Platform, thanks for posting your query here. Azure DevOps related queries/issues are currently not supported on this Microsoft Q&A platform. I would request you to please post your queries in dedicated forums as in below links: https://developercommunity.visualstudio.com/spaces/21/index.html https://developercommunity.visualstudio.com/t/get-unique-id-from-devops-organization/756710 https://stackoverflow.com/questions/tagged/azure-devops

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.