I am part of a small team working on creating GTK bindings for Kotlin/Native. We want to provide a project template that integrates Meson, the preferred build system for GTK projects, with Gradle, the build system used by Kotlin/Native. Our objective is to merge the two systems by calling Gradle from Meson, much like what has been done for Rust and Meson + Cargo.
However, we are unsure if we can currently fetch artifacts from MavenCentral, as this would require an internet connection during the Gradle build phase. We are wondering how this issue is handled with Cargo. For instance, is it possible to fetch crates from Crates.io when building an application for Flathub? If so, would it be possible to do the same for Gradle and MavenCentral?
If the answer is no, are there any known workarounds? Additionally, we are curious if there are any Java/Kotlin apps with dependencies on MavenCentral available on Flathub so that we can have a look at how they solved the issue.