# flatDir repositories do not support metadata files

**URL:** <https://discuss.gradle.org/t/flatdir-repositories-do-not-support-metadata-files/6311>\
**Category:** Old Forum Archive\
**Created:** [June 19, 2014, 10:32pm UTC](https://discuss.gradle.org/t/flatdir-repositories-do-not-support-metadata-files/6311 "2014-06-19T22:32:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cr7pt0gr4ph7](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@cr7pt0gr4ph7](https://discuss.gradle.org/u/cr7pt0gr4ph7)\
**Post date:** [June 19, 2014, 10:32pm UTC](https://discuss.gradle.org/t/flatdir-repositories-do-not-support-metadata-files/6311/1 "2014-06-19T22:32:00Z")

</div>

```gradle
flatDir

```

artifact repositories do not support metadata files (or, more exacly, only a single metadata file with name “ivy.xml”).

This is due to [this code line](https://github.com/gradle/gradle/blob/master/subprojects/core-impl/src/main/groovy/org/gradle/api/internal/artifacts/repositories/resolver/IvyResolver.java#L58) in IvyResolver.java, which is initialized by [DefaultFlatDirArtifactRepository](https://github.com/gradle/gradle/blob/master/subprojects/core-impl/src/main/groovy/org/gradle/api/internal/artifacts/repositories/DefaultFlatDirArtifactRepository.java#L81%22).

My question is: Is it intended that one cannot have metadata files for flat directory repositories? And, if no (i.e. if this is not intended): Could it be made possible to configure the metadata type (POM vs Ivy)?

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [June 20, 2014, 3:51am UTC](https://discuss.gradle.org/t/flatdir-repositories-do-not-support-metadata-files/6311/2 "2014-06-20T03:51:00Z")

</div>

Yes it’s intended. If you want a real Ivy repo, you can use ‘repositories { ivy { url “file:///…” } }’.

---

<div class="post-metadata">

**Author:** ![cr7pt0gr4ph7](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@cr7pt0gr4ph7](https://discuss.gradle.org/u/cr7pt0gr4ph7)\
**Post date:** [June 20, 2014, 2:31pm UTC](https://discuss.gradle.org/t/flatdir-repositories-do-not-support-metadata-files/6311/3 "2014-06-20T14:31:00Z")

</div>

Thank you for your answer! Maybe it’s worth adding a note to the Gradle documentation under [50.6.5 Flat directory repository](http://www.gradle.org/docs/1.12/userguide/dependency_management.html#sec:flat_dir_resolver), saying that it does not support metadata files?

Just for the record: I was able to achieve what I wanted using a custom [maven repository](http://www.gradle.org/docs/1.12/userguide/dependency_management.html#sub:maven_repo) instead:

‘maven { url “$projectDir/libs” }’.

Using this repository configuration, the artifact for ‘com.example:example-project:1.0.0-SNAPSHOT’ must be placed under ‘libs/com/example/example-project/1.0.0-SNAPSHOT/example-project-1.0.0-SNAPSHOT.jar’. The metadata files named ‘example-project-1.0.0-SNAPSHOT.pom’ must be placed in the same directory as the respective JAR.

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [June 21, 2014, 2:52am UTC](https://discuss.gradle.org/t/flatdir-repositories-do-not-support-metadata-files/6311/4 "2014-06-21T02:52:00Z")

</div>

If you’d like to help improve the docs, please send a pull request.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Schuberth](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/sebastian_schuberth/32/185_2.png) [@Sebastian\_Schuberth](https://discuss.gradle.org/u/Sebastian_Schuberth)\
**Post date:** [January 23, 2015, 10:33am UTC](https://discuss.gradle.org/t/flatdir-repositories-do-not-support-metadata-files/6311/5 "2015-01-23T10:33:00Z")

</div>

This limitation of flatDir repositories has bitten me, too. I’ve created a PR to improve the documentation in this regard: [https://github.com/gradle/gradle/pull/388](https://github.com/gradle/gradle/pull/388)
