If you do not have any settings plugins applied in either, you can use a settings script plugin from both that configures the repositories.
Or you can use a custom Gradle distribution that for example has an init script that sets the repositories in a
beforeSettings { ... }