Hi there,
I’ve been looking into making configuration caching work for our inhouse builds and plugins. Obviously there is much work to do, but I hit a stumbling block very early on, where I didn’t find any information about.
We use global gradle.properties (in userhome/.gradle) to define some system properties to configure the development environment, like artifact repo urls, credentials etc.
In the init.gradle script these are used to set up repositories for plugin resolution
But what you should strongly reconsider is using mavenLocal() at all and if, then as first and without content filter.
The local maven repo is broken by design.
If you for example also run Maven builds, some dependencies are maybe only partly in there as it is a mixture of repository and cache for Maven and only the actually downloaded things are in there.
If then later a Gradle build needs such an incomplete dependency it might silently misbehave or loudly fail.
Thanks alot, that was exactly what I was looking for
We use mavenLocal() only for local deployment of development artifacts or experimental custom plugin versions, e.g. while refactoring some low level library without breaking everyone elses build. But thanks for the hint!
Yeah, just saying it can break your normal builds if someone also builds some Maven build that happens to use libraries your Gradle build also uses.
It would be better to add mavenLocal() just temporary and with content filter at the time it is necessary.
And even better, if the downstream project is a Gradle project, just use a composite build, then you don’t need Maven Local and manual building / deploying at all, but it just works automatically and rebuilds the downstream project if necessary.