# Error Reporting: Configuration with name 'default' not found

**URL:** <https://discuss.gradle.org/t/error-reporting-configuration-with-name-default-not-found/13487>\
**Category:** Bugs\
**Created:** [December 30, 2015, 5:21pm UTC](https://discuss.gradle.org/t/error-reporting-configuration-with-name-default-not-found/13487 "2015-12-30T17:21:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xtracoder](https://avatars.discourse-cdn.com/v4/letter/x/45deac/32.png) [@xtracoder](https://discuss.gradle.org/u/xtracoder)\
**Post date:** [December 30, 2015, 5:21pm UTC](https://discuss.gradle.org/t/error-reporting-configuration-with-name-default-not-found/13487/1 "2015-12-30T17:21:08Z")

</div>

In some conditions Gradle fails to build the project with error message like:

Could not resolve all dependencies for configuration ‘:project:subproject:compile’.

> Configuration with name ‘default’ not found.

this happens because of this code:

```
package org.gradle.api.internal.artifacts.dependencies;
public class DefaultProjectDependency extends AbstractModuleDependency implements ProjectDependencyInternal {
...
    public Configuration getProjectConfiguration() {
        return dependencyProject.getConfigurations().getByName(getConfiguration());
    }
...
}

```

getConfiguration() for project dependencies actually always return ‘default’, however such configuration is not always present in some target projects. Exception report gives absolutely no clue about exact cause of the error - in multi-module projects that exception can actually come from the 10th level of dependency from the original project reported in exception.

Please provide more intelligent error reporting of that case, for example like following:

```
public Configuration getProjectConfiguration() {
    String name = getConfiguration();
    Configuration configuration = dependencyProject.getConfigurations().findByName(name);
    if( configuration == null ) {
        throw new UnknownConfigurationException(String.format(
            "Configuration with name %s is not found in %s, available configurations: %s", 
            name, dependencyProject, dependencyProject.getConfigurations()));
    }
    return configuration;
}

```

---

<div class="post-metadata">

**Author:** ![mark\_vieira](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mark_vieira/32/5396_2.png) [@mark\_vieira](https://discuss.gradle.org/u/mark_vieira)\
**Post date:** [December 30, 2015, 5:33pm UTC](https://discuss.gradle.org/t/error-reporting-configuration-with-name-default-not-found/13487/2 "2015-12-30T17:33:19Z")

</div>

Thanks, I’ve raised this as GRADLE-3375. Would you perhaps consider contributing a fix for this?

---

<div class="post-metadata">

**Author:** ![xtracoder](https://avatars.discourse-cdn.com/v4/letter/x/45deac/32.png) [@xtracoder](https://discuss.gradle.org/u/xtracoder)\
**Post date:** [December 31, 2015, 12:08am UTC](https://discuss.gradle.org/t/error-reporting-configuration-with-name-default-not-found/13487/3 "2015-12-31T00:08:07Z")

</div>

Do you require unit tests for it or so? If yes - this will take too much effort from me, i.e. to make proper unit testing.

---

<div class="post-metadata">

**Author:** ![mark\_vieira](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mark_vieira/32/5396_2.png) [@mark\_vieira](https://discuss.gradle.org/u/mark_vieira)\
**Post date:** [December 31, 2015, 3:30am UTC](https://discuss.gradle.org/t/error-reporting-configuration-with-name-default-not-found/13487/4 "2015-12-31T03:30:28Z")

</div>

I don’t think additional tests would be strictly required for this. If there are existing tests they might need to be updated to look for the new error message.
