From a8fc099b0fa64b27fd0b3f0fbbc9baac3d326339 Mon Sep 17 00:00:00 2001 From: Yeikel Date: Sun, 12 Feb 2023 15:56:56 -0500 Subject: [PATCH] Cache Maven Dists downloaded by the Maven Wrapper --- __tests__/cache.test.ts | 2 +- dist/cleanup/index.js | 4 ++-- dist/setup/index.js | 4 ++-- src/cache.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/__tests__/cache.test.ts b/__tests__/cache.test.ts index 987da4a..18861cd 100644 --- a/__tests__/cache.test.ts +++ b/__tests__/cache.test.ts @@ -81,7 +81,7 @@ describe('dependency cache', () => { await expect(restore('maven')).rejects.toThrowError( `No file in ${projectRoot( workspace - )} matched to [**/pom.xml], make sure you have checked out the target repository` + )} matched to [**/pom.xml,.mvn/wrapper/maven-wrapper.properties], make sure you have checked out the target repository` ); }); it('downloads cache', async () => { diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index 7a4f37b..bf14886 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -68236,9 +68236,9 @@ const CACHE_KEY_PREFIX = 'setup-java'; const supportedPackageManager = [ { id: 'maven', - path: [path_1.join(os_1.default.homedir(), '.m2', 'repository')], + path: [path_1.join(os_1.default.homedir(), '.m2', 'repository'), path_1.join(os_1.default.homedir(), '.m2', 'wrapper', 'dists')], // https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---maven - pattern: ['**/pom.xml'] + pattern: ['**/pom.xml', '.mvn/wrapper/maven-wrapper.properties'] }, { id: 'gradle', diff --git a/dist/setup/index.js b/dist/setup/index.js index 20ec26a..78f53be 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -103439,9 +103439,9 @@ const CACHE_KEY_PREFIX = 'setup-java'; const supportedPackageManager = [ { id: 'maven', - path: [path_1.join(os_1.default.homedir(), '.m2', 'repository')], + path: [path_1.join(os_1.default.homedir(), '.m2', 'repository'), path_1.join(os_1.default.homedir(), '.m2', 'wrapper', 'dists')], // https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---maven - pattern: ['**/pom.xml'] + pattern: ['**/pom.xml', '.mvn/wrapper/maven-wrapper.properties'] }, { id: 'gradle', diff --git a/src/cache.ts b/src/cache.ts index 20b553e..55dcc0b 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -23,9 +23,9 @@ interface PackageManager { const supportedPackageManager: PackageManager[] = [ { id: 'maven', - path: [join(os.homedir(), '.m2', 'repository')], + path: [join(os.homedir(), '.m2', 'repository'), join(os.homedir(), '.m2', 'wrapper', 'dists')], // https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---maven - pattern: ['**/pom.xml'] + pattern: ['**/pom.xml', '.mvn/wrapper/maven-wrapper.properties'] }, { id: 'gradle',