# Dependency set doubles dependency - e.g. for maven publication

**URL:** <https://discuss.gradle.org/t/dependency-set-doubles-dependency-e-g-for-maven-publication/11921>\
**Category:** Bugs\
**Created:** [September 29, 2015, 8:50am UTC](https://discuss.gradle.org/t/dependency-set-doubles-dependency-e-g-for-maven-publication/11921 "2015-09-29T08:50:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Gollnitz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/martin_gollnitz/32/375_2.png) [@Martin\_Gollnitz](https://discuss.gradle.org/u/Martin_Gollnitz)\
**Post date:** [September 29, 2015, 8:50am UTC](https://discuss.gradle.org/t/dependency-set-doubles-dependency-e-g-for-maven-publication/11921/1 "2015-09-29T08:50:13Z")

</div>

When using the war plugin the providedCompile configuration gets introduced. When I then add the maven-publish plugin and simply do a “from components.java” dependencies from the providedCompile configuration get doubled during the “withType()” call. I’m not really at the end of a full analysis, but the delegate of org.gradle.api.internal.DelegatingDomainObjectSet does this in my project.

This is (together with the fact that these dependencies are by default generated as _runtime_ dependencies in the generated pom and not _provided_ which I can easily fix in the build script.) unexpected behaviour since all the dependencies are held in _sets_.

You can find a stripped down example [build.gradle](https://gist.github.com/mgoellnitz/e0670085fa457c07eb19) illustrating this in my github space.
