I cannot make plugin repositories to work in a multi-project environment.
Specifically, if I put the buildscript {} element with repositories and dependencies within the subprojects{} in the root build script, it looks like it’s ignored (compiling subprojects fail).
I need to put the buildscript {} element into each subproject’s build script.
This happens both when using “flatDir” and local-dir Ivy repositories.
I encounter the same problem. I was trying to use the fatjar plugin (https://github.com/musketyr/gradle-fatjar-plugin) and, at first, I copy/pasted the instructions in a separate common.gradle file which I ‘apply(from: “common.gradle”);’ in build.gradle.
It failed to work until I moved the instructions into build.gradle itself…
In my case it was not in a subproject block. I had a ‘buildscript’ block in another .gradle file which I included in build.gradle using ‘apply(from: “other.gradle.file”);’.
I’d like to be able to do a very simple thing: define all of the project’s group, name, version, (Java) language version/compatibility in one file.
And right now I can’t do it. If I try and define ‘name’ in a property file and/or alternate .gradle file, I get rejected. If I try and define ‘{source,target}Compatibility}’ in a property file or in ‘settings.gradle’, they are happily ignored.
I can certainly believe this is a nontrivial task to achieve, but when it is achieved, it will make gradle usage all the more easy.
I mean, I have been doing gradle for two days only, and I am able to do more than what I was ever able to do with maven. But as far as sourcing, and using, custom properties/tasks/etc is concerned, ant stays the reference here.