actions / setup-java

Set up your GitHub Actions workflow with a specific version of Java
MIT License
1.51k stars 730 forks source link

Cache Maven distribution downloaded by Maven Wrapper #448

Open Marcono1234 opened 1 year ago

Marcono1234 commented 1 year ago

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

IvanZosimov commented 1 year ago

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

yeikel commented 1 year ago

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

fadma10 commented 1 year ago

it's runing

seepine commented 1 year ago

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

yeikel commented 1 year ago

@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

seepine commented 1 year ago

@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.