> How about java projects? How can I add a dependency to a project I’m building without it being published to a maven repo, for instance?
You can use Gradle, which supports source repositories, instead of Maven:
https://blog.gradle.org/introducing-source-dependencies