Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions __tests__/cache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,17 @@ 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 () => {
createFile(join(workspace, 'pom.xml'));

await restore('maven', '');
expect(spyCacheRestore).toHaveBeenCalled();
expect(spyGlobHashFiles).toHaveBeenCalledWith('**/pom.xml');
expect(spyGlobHashFiles).toHaveBeenCalledWith(
'**/pom.xml\n.mvn/wrapper/maven-wrapper.properties'
);
expect(spyWarning).not.toHaveBeenCalled();
expect(spyInfo).toHaveBeenCalledWith('maven cache is not found');
});
Expand Down
7 changes: 5 additions & 2 deletions dist/cleanup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51467,9 +51467,12 @@ const CACHE_KEY_PREFIX = 'setup-java';
const supportedPackageManager = [
{
id: 'maven',
path: [(0, path_1.join)(os_1.default.homedir(), '.m2', 'repository')],
path: [
(0, path_1.join)(os_1.default.homedir(), '.m2', 'repository'),
(0, 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',
Expand Down
7 changes: 5 additions & 2 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77331,9 +77331,12 @@ const CACHE_KEY_PREFIX = 'setup-java';
const supportedPackageManager = [
{
id: 'maven',
path: [(0, path_1.join)(os_1.default.homedir(), '.m2', 'repository')],
path: [
(0, path_1.join)(os_1.default.homedir(), '.m2', 'repository'),
(0, 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',
Expand Down
7 changes: 5 additions & 2 deletions src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ 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',
Expand Down
Loading