I load a generic master gradle script in the buildscript block of my application specific build.gradle script. The master gradle configures a set of remote repositories.
Sometimes it is necessary for me to use a snapshot version of a separate library that I want to load from my local maven repository. I don’t want to publish this snapshot version to the remote repo.
If I add mavenLocal() to the repositories block in the master gradle, it works find. If I publish a new snapshot version to my local maven repo, gradle detects the new version and load it if I build my application.
But for me it seems to be nicer to add the mavenLocal() in a repositiories closure inside of my own gradle.buid script instead of the gerenic master gradle. If I do that, then gradle ignores the changed snapshot versions and does not load it any more (maybe it first searches in the remote and if it is there and has not changed, it stops searching in other repos?).
Is there a way to change the repositories order in my build.gradle script or any other generic solution?