# Gradle fails to create POM with "The configuration to scope mapping is not unique."

**URL:** <https://discuss.gradle.org/t/gradle-fails-to-create-pom-with-the-configuration-to-scope-mapping-is-not-unique/32087>\
**Category:** Help/Discuss\
**Created:** [June 13, 2019, 9:34am UTC](https://discuss.gradle.org/t/gradle-fails-to-create-pom-with-the-configuration-to-scope-mapping-is-not-unique/32087 "2019-06-13T09:34:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![flow](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/flow/32/1968_2.png) [@flow](https://discuss.gradle.org/u/flow)\
**Post date:** [June 13, 2019, 9:34am UTC](https://discuss.gradle.org/t/gradle-fails-to-create-pom-with-the-configuration-to-scope-mapping-is-not-unique/32087/1 "2019-06-13T09:34:44Z")

</div>

Since a few weeks (and probably gradle versions), I am unable to upload the archives to Maven Central. If I don’t invoke gradle with `--stacktrace` I get

```bash
$ gradle uploadArchives
> Task :smack-android:uploadArchives FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':smack-android:uploadArchives'.
> Could not publish configuration 'archives'
   > Could not write to file '/home/flo/data/code/smack/smack-android/build/poms/pom-default.xml'.

```

using `--stacktrace` yields

```gradle
Caused by: org.gradle.api.InvalidUserDataException: The configuration to scope mapping is not unique. The following configurations have the same priority: [org.gradle.api.artifacts.maven.Conf2ScopeMapping@856ed98c, org.gradle.api.artifacts.maven.Conf2ScopeMapping@62c4ce18]
        at org.gradle.api.publication.maven.internal.pom.DefaultConf2ScopeMappingContainer.getMapping(DefaultConf2ScopeMappingContainer.java:41)
        at org.gradle.api.publication.maven.internal.pom.DefaultPomDependenciesConverter.createDependencyToScopeMap(DefaultPomDependenciesConverter.java:68)
        at org.gradle.api.publication.maven.internal.pom.DefaultPomDependenciesConverter.convert(DefaultPomDependenciesConverter.java:48)
        at org.gradle.api.publication.maven.internal.pom.DefaultMavenPom.getGeneratedDependencies(DefaultMavenPom.java:170)
        at org.gradle.api.publication.maven.internal.pom.DefaultMavenPom.getEffectivePom(DefaultMavenPom.java:176)
        at org.gradle.api.publication.maven.internal.pom.DefaultMavenPom.writeTo(DefaultMavenPom.java:193)
        at org.gradle.api.publication.maven.internal.pom.DefaultMavenPom$2.execute(DefaultMavenPom.java:203)
        at org.gradle.api.publication.maven.internal.pom.DefaultMavenPom$2.execute(DefaultMavenPom.java:201)
        at org.gradle.internal.IoActions$TextFileWriterIoAction.execute(IoActions.java:146)
        ... 104 more

```

You can see the full output at: [http://paste.debian.net/1087703/](http://paste.debian.net/1087703/)

I am using Gradle 4.4.1 to upload the archives of the FOSS library [Smack](https://github.com/igniterealtime/Smack).

I am not sure what the cause of this is, as I don’t remember changing anything related to POM configuration in Smack recently. Any help or pointers in the right direction to solve this is appreciated.

---

<div class="post-metadata">

**Author:** ![trejkaz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/trejkaz/32/3338_2.png) [@trejkaz](https://discuss.gradle.org/u/trejkaz)\
**Post date:** [September 18, 2019, 12:04am UTC](https://discuss.gradle.org/t/gradle-fails-to-create-pom-with-the-configuration-to-scope-mapping-is-not-unique/32087/2 "2019-09-18T00:04:23Z")

</div>

Getting the same error here today. Did you ever figure it out?

---

<div class="post-metadata">

**Author:** ![flow](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/flow/32/1968_2.png) [@flow](https://discuss.gradle.org/u/flow)\
**Post date:** [September 18, 2019, 6:25am UTC](https://discuss.gradle.org/t/gradle-fails-to-create-pom-with-the-configuration-to-scope-mapping-is-not-unique/32087/3 "2019-09-18T06:25:20Z")

</div>

> <https://github.com/igniterealtime/Smack/commit/90cbcaebc7a89f4f771f733a33ac9f389df85be2>

fixed it for me.
