Resolving dependencies shall not fail in the case of unresolvable dependencies


I have a configuration with unresolvable dependencies and I would like just to print out the unresolvable once. The build itself shall not fail. According to the API the lenientConfiguration should be used to achieve that. I wrote following piece of code:

def configuration = getConfigurations().getByName('compile')
def resolvedConfiguration = configuration.getResolvedConfiguration()
resolvedConfiguration.getLenientConfiguration().unresolvedModuleDependencies.each() {
  println "ERROR: $it.selector ($it.problem)"

The build fails with exception in the second line of code. What did I wrong? (I am using gradle 2.1)

Kind Regards Markus

What exception are you getting?

In general, you might have better results using the newer ‘ResolutionResult’ API.…