How to add extra repositories to existing repositories configuration

( #1

Hi folks, I’ve created a common build script that I apply to multiple projects using the ‘apply from’ command. This common build script includes a repositories section containing the repositories that are used by all our projects. For some of our projects we need to add an extra repository. I tried to achieve this by adding another repositories section directly in the build scripts for those projects that required it. But this has the effect of reconfiguring the repositories for the project and overwriting those that i had configured in the common script.

How do i add another repository in addition to those defined in the common script?

(Peter Niederwieser) #2

You just add another ‘repositories {}’ section for selected projects, which is apparently what you did. I doubt that you overwrote some repositories, as there is no straightforward way to do so. Maybe it seemed like it due to the order in which repositories are being checked.

( #3

Hi Peter, I think you may be right. I had reverted to declaring all repositories in the build scripts themselves to get things working. I setup a quick test to see if I could reproduce my problem and it worked fine this time.

But I’ve decided to leave the repositories declaration all in one place now. I was looking to avoid duplication but I think the lack of transparency is probably worse.

Thanks for your help.