-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better handling for broken connection to Foojay backend #47
Comments
Hey there, I'm here because of the same error. I may not have a clear understanding of the purpose of this plugin, but if we're running a build in docker container like |
FYI it's related to upstream downtime with foojay.io, being tracked at foojayio/discoapi#85 |
Back online now. |
The "problem" within the plugin is, that it made always connection to Currently, in case the api call doesn't succeed, this plugin throws an exception. In this case it could be possible that: Hmm.. 🤷♂️ 😂 |
Just thought about this again. Therefore resolvers like this plugin don't have the information if a url should be provided or not. It just does it... Right? 🤔 So what is gradle doing? Maybe this logic should change. It should first check if the jdk is already available and afterwards ask the resolver to provide the url (in case it is not available locally)... Not sure if Iam correct with my assumptions 😂 |
The API went down again today -- foojayio/discoapi#96 This PR, in particular @StefMa's ideas on how the logic should work, would be really impactful. The API is up perfectly nearly all of the time, but when it's not, all gradle builds fail. I think the community would appreciate a way to leave out hitting the API and still use toolchains, especially when it's a certainty that the desired JDK is available locally. |
The purpose of this plugin is to facilitate the download of a java toolchain IF you don't already have one locally. Gradle will not download anything if it can find a local one. If you think you have a JDK/JRE locally and you still see this plugin in action, then you have the local ones misconfigured somehow. See here: https://docs.gradle.org/current/userguide/toolchains.html#sec:auto_detection |
You're wrong with your assumptions. If there are locally available matching JDK/JREs, then no downloading/connecting to Foojay will take place. This is core Gradle logic, see https://github.com/gradle/gradle/blob/1e9501765e70a9dab7604ef58a3fef8d7a27e390/platforms/jvm/toolchains-jvm/src/main/java/org/gradle/jvm/toolchain/internal/JavaToolchainQueryService.java |
This sound like a good idea, contributions welcome. |
I'm closing this issue, discussions on the reason can be found in the PR's comments. |
Possible future enhancements: Better error message. Fallback to something else.
The text was updated successfully, but these errors were encountered: