I have a few repositories through which dependencies can be found however I only want to add 1 of them (mavenLocal) if certain tasks are not in the task graph. I also want this one to win in the event of clashes which means I need to add this one first.
This presents a problem as the mavenLocal() method adds it to the end of the list and I can only add this repository when the task graph is ready which means I need to defer adding the other repositories too (and this causes a problem with jacoco configuration which I need resolve to construct the required javaagent path for configuring the test task).
It seems I need something like the ability to tell it to add mavenLocal “first”. This seems feasible as there is an ‘addFirst’ method on ‘ArtifactRepositoryContainer’ but creating mavenLocal needs the ResolverFactory which appears to be internal hence not publicly accessible. Is there something I’m missing here?
Alternatively is there another way to achieve what I need?