How to retrieve all project dependencies (from non-resolving configurations)

Hello all, I am trying to get Gradle project dependencies and I am struggling with retrieving dependencies from configurations with resolving errors. Basically, I collect dependencies from all configurations by calling ‘resolve’ method on each configuration:

project.configurations.collect { configuration ->

Unfortunately this approach does not work when some of the configurations fails to resolve. I found out that I am able to overcome this issue by using:


and not to collect dependencies from failing configurations. Although this works, I do not like this solution because configurations may contain many dependencies - by failing to resolve one dependency, all the other dependencies are not being collected, although Gradle is able to resolve them. To overcome this problem, I tried to use:


This kind of works, but the files returned do not correspond to what is being retrieved by calling configuration.resolve(). For example, when I compare the output for project ‘mockito’ ( using both approaches, the configuration.resolve() method returns one dependency more:


This happens even when ‘mockito’ does not have any problems with resolving dependencies.

Can anyone help me here please? Am I missing something?

Check out It returns a set of resolved and unresolved dependencies.