Funny that
you should ask that. Disclaimer, though. "Right" means about as much as "Best" here, and to me "Best" is a 4-letter
word.
But is this a "library", or is this a platform? Your choices for libraries are rarely that rich once you've got a language environment fixed.
I maintain a private GitHub-style repository on my server farm that I use for personal infrastructure change tracking and archiving and as a communications medium for client projects. For years I've been using Gogs. It's available in container form, simple to setup and open-source, as I prefer my software to be.
But it has one fatal flaw. When started cold, it does a scan-and-repair of all the archives and there are now thousands of files in those archives when you count the git meta-information. And that can take FOREVER.
I had to rebuild the server that the Gogs container runs on the other day and after 14 hours, I started looking for an alternative. Previously, I'd patched a script to avoid redundant fix operations, but the latest release of Gogs no longer has that script and I didn't want to have to make mods to a project written in Go.
Gogs is a great product, but unfortunately, lacks timely support. As I understand it, the author is not fluent in English (Japanese) and only works on it when convenient.
So I fired up Google and looked for possible replacements. After throwing out the obvious disqualifiers, I ended up with 2 and at that point it was almost a coin flip. One was in
Java, the other in Go, but the one in Go (Gitea) is a fork of Gogs. Since Gogs has more fans than support, a bunch of people forked it and support it as a group. Now in theory, it also can migrate from Gogs, but that requires a Gogs backup and you can only backup Gogs from the webapp and the webapp only starts after all the file-scanning is done and the file-scanning showed no signs of completion after more than 24 hours, I've been having to pull projects from the Gogs repository files by main force and add them to Gitea manually. Could be worse, though. Gogs could have been using a non-standard repository file format.
So I hope that this resolves the problem. Otherwise, I do it all over again.
As a design note, it's NEVER a good idea for a webapp to spend much time in its initialization code. You should be able to do at least the bare minimum of web application after no more than a minute or so. This whole debacle could have been avoided if, instead of doing the file repair in the init code, it ran it as a background or just-in-time process.
Now, as to libraries, I did have a project that used Apache OpenJPA. I was happy with it until one day I needed a feature that hadn't yet been added. JPA, of course, is a standard, so I switched from OpenJPA to Hibernate and that was a job that could be done in less than half an hour. Why Hibernate? Mostly because "everybody uses Hibernate". Plus it had the needed feature. Otherwise, it would have been the next library I could find.
This works better with standard APIs than with generic stuff like, say building PDFs. In such a case, all you can do it look for essential features and discard all the candidates that don't make you feel comfortable in their support, maybe try a pilot project, and hope for the best.