Skip to content
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

Disable gradle version check for non-public wrapper URL #241

Closed
imanushin opened this issue Jun 18, 2018 · 6 comments
Closed

Disable gradle version check for non-public wrapper URL #241

imanushin opened this issue Jun 18, 2018 · 6 comments

Comments

@imanushin
Copy link

Short idea: fix gradle version check for non-official gradle distributions.

In our company we don't have access to the internet from gradle scripts.

So, we use custom distribution URL, e.g. our gradle-wrapper.properties file is like this:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://<intranet-gradle-distribution-site>/org/gradle/binaries/gradle-4.8-all.zip

The main issue: plugin gets timeout error during the gradle version verification (and it works for a long time).

Possible solutions:

  • Add ability to disable gradle updates check from task dependencyUpdates
  • Use distribution URL from file for next version lookup (e.g. for version 4.8 we can check 5.0, 4.9, 4.8.1, nothing more, because SemVer has three kinds)
@ben-manes
Copy link
Owner

Does a private distribution url provide the same lookup api that the public one does? Note that for Gradle itself is not in a maven repository but uses a custom REST endpoint.

@imanushin
Copy link
Author

@ben-manes , unfortunately no. It just supports 404 response for missing resource .

@ben-manes
Copy link
Owner

In that case then I don't think we'd want to create a new ad hoc lookup scheme. For dependencies we let Gradle do the work and for the distribution lookup we use a custom resolver based on the public API. The more we customize and diverge, the more painful it is to catch-up as the build tool evolves.

I think your idea of a flag to disable the check is best. It would be nice to use the distributionUrl and infer the best approach, but that sounds like it might be more problematic than its worth?

@imanushin
Copy link
Author

@ben-manes , I agree with disabling gradle updates check. However I don't understand your suggestion.

Do you suggest to use distributionUrl for API url lookup? In this case right urls will works fine, invalid urls will get server error fast. This is fully ok for me (it is not problem to get error, the initial issue - error is delivered for too long time).

Or possible do you suggest to put flag into gradle/gradle.properties/gradle-wrapper.properties files?

@ben-manes
Copy link
Owner

Sorry, I meant that ideally we might infer from the distributionUrl whether to perform the check, how to perform it, etc. But that sounds pretty magical and error-prone, so adding a task-level flag to enable/disable seems like a better idea.

@aaronols contributed this feature so fyi in case you have any thoughts.

ben-manes added a commit that referenced this issue Jun 19, 2018
The task property `checkForGradleUpdate` is defaulted to `true`. When set to
`false` no check is performed, the plain text report, does not include the
statement, and the json/xml report includes an enable flag, no version, and
the reason.

Due to URLConnection defaulting to infinite timeout that can cause a hung build,
the maximum connection and read timeouts are set to 15 seconds as a failsafe.
@ben-manes
Copy link
Owner

The release will be live after the TravisCI build completes (as it does our releases for us based on new tags). Should take just a few minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants