# NPE when extending a configuration defined in another project

**URL:** <https://discuss.gradle.org/t/npe-when-extending-a-configuration-defined-in-another-project/8722>\
**Category:** Bugs\
**Tags:** issue-acknowledged, gradle-3277\
**Created:** [April 8, 2015, 9:39am UTC](https://discuss.gradle.org/t/npe-when-extending-a-configuration-defined-in-another-project/8722 "2015-04-08T09:39:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![steven\_aerts](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@steven\_aerts](https://discuss.gradle.org/u/steven_aerts)\
**Post date:** [April 8, 2015, 9:39am UTC](https://discuss.gradle.org/t/npe-when-extending-a-configuration-defined-in-another-project/8722/1 "2015-04-08T09:39:15Z")

</div>

I am able to trigger a `NullPointerException` in gradle when a project tries to extend the configuration of another subproject.  
The following minimal `build.gradle` file triggers it:

```
project(':A') {
  configurations { aConfig }
  dependencies { aConfig fileTree('lib') }
}
project(':B') {
  configurations {
    bConfig.extendsFrom(project(':A').configurations.aConfig)
  }
  task crash { doLast { configurations.bConfig.each{} } }
}

```

I crashes due to a `NullPointerException` in `AbstractModuleDescriptorBackedMetaData.java`.

Validated on gradle 2.4 nightly, 2.3 and 2.2.1.

---

<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:** [April 9, 2015, 10:36pm UTC](https://discuss.gradle.org/t/npe-when-extending-a-configuration-defined-in-another-project/8722/2 "2015-04-09T22:36:07Z")

</div>

Extending configurations from other projects isn’t officially supported. See the development mailing list thread below. What exactly are you trying to accomplish by doing this? Perhaps there is a better solution.

[https://mail.google.com/mail/u/1/#search/extend+configuration+from+another+project/14b2d315c6842a0e](https://mail.google.com/mail/u/1/#search/extend+configuration+from+another+project/14b2d315c6842a0e)

---

<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:** [April 9, 2015, 11:31pm UTC](https://discuss.gradle.org/t/npe-when-extending-a-configuration-defined-in-another-project/8722/3 "2015-04-09T23:31:17Z")

</div>

I’ve gone head and raised this issue as GRADLE-3277.
