Title: Add extra cache key for multiple jobs on the same pom, but a different part · Issue #705 · actions/setup-java · GitHub
Open Graph Title: Add extra cache key for multiple jobs on the same pom, but a different part · Issue #705 · actions/setup-java
X Title: Add extra cache key for multiple jobs on the same pom, but a different part · Issue #705 · actions/setup-java
Description: Description: I want to optionally annotate the cache-key with an extra description, such that if we have multiple jobs, that all only have a partial execution of the pom, they can still get a full cached .m2 repo. Something like: - name:...
Open Graph Description: Description: I want to optionally annotate the cache-key with an extra description, such that if we have multiple jobs, that all only have a partial execution of the pom, they can still get a full ...
X Description: Description: I want to optionally annotate the cache-key with an extra description, such that if we have multiple jobs, that all only have a partial execution of the pom, they can still get a full ...
Opengraph URL: https://github.com/actions/setup-java/issues/705
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add extra cache key for multiple jobs on the same pom, but a different part","articleBody":"**Description:**\r\nI want to optionally annotate the cache-key with an extra description, such that if we have multiple jobs, that all only have a partial execution of the pom, they can still get a full cached .m2 repo.\r\n\r\nSomething like:\r\n\r\n```yaml\r\n - name: Set up JDK\r\n uses: actions/setup-java@v4\r\n with:\r\n java-version: ${{ matrix.jdk }}\r\n cache: 'maven'\r\n cache-key-prefix: 'test'\r\n```\r\n\r\n\r\n**Justification:**\r\nFor example\r\n\r\n- runner 1 only runs `mvn test` (possibly in a matrix)\r\n- runner 2 triggers some lints with `mvn check` (runs in parallel to runner 1)\r\n- runner 3 runs the build \u0026 publish action after 1 and 2 are done\r\n\r\nRight now, for a new pom the following happens:\r\n\r\n1. runner 1 sees a new checksum, so it doesn't download an old cache, and then starts the regular.\r\n2. at the end of runner 1, the current .m2 repo, that is only filled with the plugins to run `mvn test` gets submitted as the cache for this specific pom.xml\r\n3. runner 2 actually races with this submission, with again a sub-optimal filled .m2 repo\r\n4. runner 3 starts, downloads the cache of runner 1 or runner 2\r\n5. the maven command that is run has to download quite some dependencies not needed for testing or checking.\r\n6. as runner 3 stops, the java-action plugin does not upload this .m2 repo, as there was a cache hit when it started.\r\n\r\nIn situations like this, every run afterwards will have runner 3 re-download dependencies, and runner 1 or 2, depending on who lost the race. The current workaround is to add some spaces to the pom.xml just before the `setup-java` action is run.\r\n\r\n\r\n**Are you willing to submit a PR?**\r\nYes, if I get an indication if such a PR has a chance of getting merged, I'm willing to allocate some time to add this.","author":{"url":"https://github.com/DavyLandman","@type":"Person","name":"DavyLandman"},"datePublished":"2024-11-11T12:07:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/705/setup-java/issues/705"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c9308f4f-03ca-57b6-a277-1cd91653d3c2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A670:37A81A:2B36C82:3ADF105:6A53C537 |
| html-safe-nonce | ab30042d115b31d3f41da8e986ff9c1e2eea1faf91031c16e566042a0215d543 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjcwOjM3QTgxQToyQjM2QzgyOjNBREYxMDU6NkE1M0M1MzciLCJ2aXNpdG9yX2lkIjoiODE1OTg1NTM1MzgyNDM5MjIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 31231064ab9b659ae80ca93f93023e90181411b45a0d41ccfec99002abd9eeb2 |
| hovercard-subject-tag | issue:2649156325 |
| github-keyboard-shortcuts | repository,issues,actions,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/actions/setup-java/705/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ddd5e228f1503b4783f3cd26b9f3e4152077b55eca40bda5e1782f81feed5b12/actions/setup-java/issues/705 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ddd5e228f1503b4783f3cd26b9f3e4152077b55eca40bda5e1782f81feed5b12/actions/setup-java/issues/705 |
| og:image:alt | Description: I want to optionally annotate the cache-key with an extra description, such that if we have multiple jobs, that all only have a partial execution of the pom, they can still get a full ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DavyLandman |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/actions/setup-java git https://github.com/actions/setup-java.git |
| octolytics-dimension-user_id | 44036562 |
| octolytics-dimension-user_login | actions |
| octolytics-dimension-repository_id | 196057608 |
| octolytics-dimension-repository_nwo | actions/setup-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 196057608 |
| octolytics-dimension-repository_network_root_nwo | actions/setup-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width