Open ykartsev opened 2 months ago
First diagnosis: at some point, the search API offered by Maven Central returns an HTML page with a generic HTTP 504 (Gateway timeout) message, rather than a JSON response:
<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
</body>
</html>
I think MCS could improve in two ways:
Thank you @mthmulders ! And thanks for adding those enhancement issues - really nice to see it's an active project and you take care of it.
I just thought about something a bit related: would it make sense to have an option to only include the latest version of found dependency? Does Maven API support that? That way number of results can be drastically reduced and usability would increase a lot. For example, a class might exist in multiple versions of a dependency, starting from 1.0, hence the search would return all those hundreds of results per single dependency. But if there was a flag to tell "I care only about the latest" - that would be always one per dependency and the list would be much shorter. Worst case, if Maven doesn't support that - results can be requested in chunks (known to not cause this issue for Maven), then arranged by name and version and then latest versions returned. Considering Maven naming convention, this should be doable. I might even try to contribute if Maven does not support that :)
- Suggest this issue ("Error parsing the search result") may be caused because the user requests a lot of items. I've added some debug logging locally and observed it happens roughly around ~1000 items or more.
To elaborate a bit more: when you specify a limit above 200 (constant defined here, in accordance with the remote API never returning more than 200 items per request), MCS will iterate until it has retrieved all items that match the query or retrieved the number of items you have requested - whichever comes first.
The aforementioned HTML response consistently appears when MCS asks for items 1200 to 1400 in your query.
Thank you @mthmulders ! And thanks for adding those enhancement issues - really nice to see it's an active project and you take care of it.
You're welcome, and thanks for the nice words!
I just thought about something a bit related: would it make sense to have an option to only include the latest version of found dependency? Does Maven API support that? That way number of results can be drastically reduced and usability would increase a lot.
That's an interesting feature to consider! Often, you don't care for the gazillion of older versions that are around :-). Would you be so kind to open a new issue for this idea?
Would you be so kind to open a new issue for this idea? Thank you, added #403!
First of all, thank you for a great tool. For some reason I did not find any other way to search Maven repo by full class name (various websites don't work), so it's very useful!
I just built the latest snapshot of MCS (0.7.1) and tried to run the following search:
and got the following error:
I must admit that running it with default number of results worked fine:
resulted in:
Thank you.