"You must specify a base url or at least one artifact pattern for an Ivy repository." error

Hi all,

I’m running gradle v6.8.3 and randomly run into the following error when one of the gradle tasks are executing
> You must specify a base url or at least one artifact pattern for an Ivy repository.

The error occurs at random times and is not reproducible on command. It seems like any gradle task can run into the issue with some more frequently running into it than others. Most commonly, the ...:compileJava commands are what seem to trigger it.

The confusing part is that it seems like there is an ivy artifact pattern stated.

                ivy {
                    name = "Node.js"
                    patternLayout {
                    metadataSources {

It’s difficult to debug since it’s not reproducible on command as far as I can tell. Has anyone else ran into an issue like this? It seems similar to some other topics running into the issue You must specify a URL for a Maven repository but so far haven’t been able to pinpoint what the issue here is.

Thanks for your help in advance!

I’ve found the place in the gradle code base that is throwing the exception.

This isn’t super helpful given that I don’t understand the rest of the codebase though.

Maybe you should update your Gradle version, from 7.0 on it also tells the name of the repository that has the problem, so that you know actually whether it is that repository it complains about.

Besides that, what is your full build script?
Where do you do that configuration?
Is it for example done in some tasks execution phase and thus can maybe be too late or something like that?