For Maven, flatpak/flatpak-builder#58 (comment) is probably useful to know about (and used by some existing apps on Flathub).
Originally posted by @wvengen in #37
I noticed the original issue listed maven and gradle but was closed when gradle support was added. since ive started experimenting with this on my fork (not yet ready to contribute) and since I found this comment helpful, I wanted to make a separate issue to track progress