I have a remote ivy repo that gradle logs into and downloads dependencies from. I kept getting the “configuration ‘compile’ declares a dependency on configuration ‘default’ which is not declared in the module descriptor” error for about two days and I could not figure it out. I saw this post and although he doesn’t spell it out it’s really answered:
So after getting this error for about two days, and I eventually tried doing this:
We know that default is a reserved keyword in groovy, so you have to prefix with “it.” to refer back to the dependecies object since default is a method in this case.
So…
A) I want people who are having this issue to know how about the work around.
B) I want to ask what I’m doing wrong.
What am I doing wrong? I don’t see anywhere on the internet people using it.default as the configuration for a dependency. Any ideas?
I’m throwing out an idea here, but could the problem come from the fact that you declare your ‘compile’ configuration with a private visibility in your ivy.xml ?
This makes it invisible from outside the ivy descriptor.
Therefore when gradle tries to check it, it can’t find it, and falls back to the ‘default’ configuration, that you don’t declare.
Note that the gradle internal ivy-publish plug-in publishes the following configuration block in a ‘regular’ ivy publication:
configurations
conf name=“default” visibility=“public” extends="runtime"
conf name=“runtime” visibility="public"
configurations
and it’s still not working. I also changed the second library’s ivy file to make sure all configurations are public and it has the default configuration but no such luck. I’m guessing it’s the ivy file that’s the problem so I’ll keep trying different things with that. I’m going to take out the other dependencies and try removing the configurations that aren’t normally generated by gradle (as you mentioned, it only creates default and runtime). I’ll post back after trying this.
Last blind try here:
Put ‘conf=“runtime->default”’ in the ivy.xml for your dependency artifact
I.e. ‘artifact name=“lib-artifact1” type=“jar” ext=“jar” conf=“runtime->default”’