# Repositories.mavenDeployer don't add dependency type attribute to the result pom.xml

**URL:** <https://discuss.gradle.org/t/repositories-mavendeployer-dont-add-dependency-type-attribute-to-the-result-pom-xml/1297>\
**Category:** Old Forum Archive\
**Created:** [January 11, 2015, 7:35pm UTC](https://discuss.gradle.org/t/repositories-mavendeployer-dont-add-dependency-type-attribute-to-the-result-pom-xml/1297 "2015-01-11T19:35:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomas\_Prochazka](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/tomas_prochazka/32/261_2.png) [@Tomas\_Prochazka](https://discuss.gradle.org/u/Tomas_Prochazka)\
**Post date:** [January 11, 2015, 7:35pm UTC](https://discuss.gradle.org/t/repositories-mavendeployer-dont-add-dependency-type-attribute-to-the-result-pom-xml/1297/1 "2015-01-11T19:35:00Z")

</div>

If you want to deploy library which has dependency on something different like .jar gradle generate invalid pom.xml for the library because it skip element in .

Example I have library project which has this dependency:

```gradle
compile 'com.android.support:appcompat-v7:21.0.0'

```

During deploy gradle create this in the targer pom.xml

```gradle
<dependencies>
    <dependency>
      <groupId>com.android.support</groupId>
      <artifactId>support-v4</artifactId>
      <version>21.0.3</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>

```

But aar is missing ☹ So this pom.xml is invalid, because if is missing it should be jar, but jar type dependency doesn’t exist in the repo.

It is possible to fix it by this workaround

```gradle
uploadArchives {
    repositories.mavenDeployer {
        pom.groupId = groupId
        pom.artifactId = artifactId
        pom.version = version
        // Add other pom properties here if you want (developer details / licenses)
        repository(url: "file://${localReleaseDest}")
        // workaround for: https://code.google.com/p/android/issues/detail?id=72807
        pom.whenConfigured { pom ->
            pom.dependencies.findAll { dependency ->
                if (dependency.artifactId == 'appcompat-v7') {
                    dependency.type = 'aar'
                }
            }
        }
    }
}

```

But I think that gradle should do itself.

---

<div class="post-metadata">

**Author:** ![Tomas\_Prochazka](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/tomas_prochazka/32/261_2.png) [@Tomas\_Prochazka](https://discuss.gradle.org/u/Tomas_Prochazka)\
**Post date:** [March 7, 2015, 9:58pm UTC](https://discuss.gradle.org/t/repositories-mavendeployer-dont-add-dependency-type-attribute-to-the-result-pom-xml/1297/2 "2015-03-07T21:58:00Z")

</div>

Another topic with the same problem [http://forums.gradle.org/gradle/topics/missing-in-deployed-pom-files-if-different-than-jar-artifact-is-used](http://forums.gradle.org/gradle/topics/missing-in-deployed-pom-files-if-different-than-jar-artifact-is-used)
