setup-java icon indicating copy to clipboard operation
setup-java copied to clipboard

Cache Maven distribution downloaded by Maven Wrapper

Open Marcono1234 opened this issue 2 years ago • 7 comments

Description: Cache the Maven distribution downloaded by the official Maven Wrapper.

The cache key should probably be derived from the .mvn/wrapper/maven-wrapper.properties file (see documentation), similar to how it is done already for the Gradle Wrapper.

The directory to cache is ~/.m2/wrapper/dists (see documentation).

Justification: Without caching, projects using the Maven Wrapper would have to download the Maven distribution (~8MB) every time the project is built.

For Gradle the setup-java action already supports caching the Gradle distribution downloaded by the wrapper: https://github.com/actions/setup-java/blob/8f12c5c4d1ebd18bf4b7a51a1b0b912633f0bc61/src/cache.ts#L36 https://github.com/actions/setup-java/blob/8f12c5c4d1ebd18bf4b7a51a1b0b912633f0bc61/src/cache.ts#L32

Are you willing to submit a PR?

Probably not

Marcono1234 avatar Jan 29 '23 18:01 Marcono1234

Hi, @Marcono1234 👋 Thank you for the feature request! We will investigate it and get back to you with our decision as soon as possible.

IvanZosimov avatar Jan 30 '23 08:01 IvanZosimov

@IvanZosimov I submitted https://github.com/actions/setup-java/pull/453 for this

yeikel avatar Feb 16 '23 16:02 yeikel

it's runing

fadma10 avatar Apr 20 '23 18:04 fadma10

@yeikel Hi, maybe you can support gradlew also, this is really useful of cache mvnw and gradlew

seepine avatar Jul 14 '23 06:07 seepine

@yeikel Hi, maybe you can support gradlew also, this is really useful of cache mvnw and gradlew

I think that we should track that separately

yeikel avatar Jul 14 '23 09:07 yeikel

@yeikel Hi, maybe you can support gradlew also, this is really useful of cache mvnw and gradlew

I think that we should track that separately

You are right, maybe not work of cache gradlew due to excessive cache size, i find it work just now.

seepine avatar Jul 14 '23 11:07 seepine