diff --git a/__tests__/cache.test.ts b/__tests__/cache.test.ts index f6932a7cc..b538b5a5e 100644 --- a/__tests__/cache.test.ts +++ b/__tests__/cache.test.ts @@ -85,7 +85,7 @@ describe('dependency cache', () => { await expect(restore('maven')).rejects.toThrow( `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 56df7de43..c117d8a0d 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -66616,9 +66616,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 cf4bf075e..f3fbf19e4 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -101821,9 +101821,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 7dd8da9a9..547f0b409 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',