build script - How to define repositories for all subprojects in Gradle -


i writing gradle scripts build lot of projects. using same repositories define repositories of sub-projects instead of defining in each of them. try move repositories definition build.gradle in individual project build.gradle in parent folder.

subprojects{     repositories{         mavencentral()         flatdir{             name 'uploadrepository'             dirs '../../sharedlib'         }     } } 

however, sub-projects can't find repository definition @ all. moving other configurations in subprojects closure work. i've tried dependencies , properties configuration. work no problem. don't know why repositories work differently. when googling, can't find example of putting repositories inside subprojects, suspect doing wrong way. please tell me what's wrong. thanks!

i figured out problem was. originally, missed settings.gradle in parent folder. (i don't know why dependencies configuration works without file) after put in, sub-projects find repositories, dependencies , 1 property (sourcecompatibility=1.5) defined in parent project no longer works. have move apply plugin:'war' subproject's build.gradle parent's subprojects{...} figure that's because dependencies , sourcecompatibility things provided plugin. , somehow gradle doesn't subproject's script find plugin first.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -