Skip to content

Commit a8fc099

Browse files
yeikelYeikel
authored andcommitted
Cache Maven Dists downloaded by the Maven Wrapper
1 parent ea15b3b commit a8fc099

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

__tests__/cache.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe('dependency cache', () => {
8181
await expect(restore('maven')).rejects.toThrowError(
8282
`No file in ${projectRoot(
8383
workspace
84-
)} matched to [**/pom.xml], make sure you have checked out the target repository`
84+
)} matched to [**/pom.xml,.mvn/wrapper/maven-wrapper.properties], make sure you have checked out the target repository`
8585
);
8686
});
8787
it('downloads cache', async () => {

dist/cleanup/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68236,9 +68236,9 @@ const CACHE_KEY_PREFIX = 'setup-java';
6823668236
const supportedPackageManager = [
6823768237
{
6823868238
id: 'maven',
68239-
path: [path_1.join(os_1.default.homedir(), '.m2', 'repository')],
68239+
path: [path_1.join(os_1.default.homedir(), '.m2', 'repository'), path_1.join(os_1.default.homedir(), '.m2', 'wrapper', 'dists')],
6824068240
// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---maven
68241-
pattern: ['**/pom.xml']
68241+
pattern: ['**/pom.xml', '.mvn/wrapper/maven-wrapper.properties']
6824268242
},
6824368243
{
6824468244
id: 'gradle',

dist/setup/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103439,9 +103439,9 @@ const CACHE_KEY_PREFIX = 'setup-java';
103439103439
const supportedPackageManager = [
103440103440
{
103441103441
id: 'maven',
103442-
path: [path_1.join(os_1.default.homedir(), '.m2', 'repository')],
103442+
path: [path_1.join(os_1.default.homedir(), '.m2', 'repository'), path_1.join(os_1.default.homedir(), '.m2', 'wrapper', 'dists')],
103443103443
// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---maven
103444-
pattern: ['**/pom.xml']
103444+
pattern: ['**/pom.xml', '.mvn/wrapper/maven-wrapper.properties']
103445103445
},
103446103446
{
103447103447
id: 'gradle',

src/cache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ interface PackageManager {
2323
const supportedPackageManager: PackageManager[] = [
2424
{
2525
id: 'maven',
26-
path: [join(os.homedir(), '.m2', 'repository')],
26+
path: [join(os.homedir(), '.m2', 'repository'), join(os.homedir(), '.m2', 'wrapper', 'dists')],
2727
// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---maven
28-
pattern: ['**/pom.xml']
28+
pattern: ['**/pom.xml', '.mvn/wrapper/maven-wrapper.properties']
2929
},
3030
{
3131
id: 'gradle',

0 commit comments

Comments
 (0)