# How do i create a local maven/ivy repository and fill it?

**URL:** <https://discuss.gradle.org/t/how-do-i-create-a-local-maven-ivy-repository-and-fill-it/7106>\
**Category:** Old Forum Archive\
**Created:** [January 31, 2014, 4:49am UTC](https://discuss.gradle.org/t/how-do-i-create-a-local-maven-ivy-repository-and-fill-it/7106 "2014-01-31T04:49:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ray\_Tayek](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/ray_tayek/32/4985_2.png) [@Ray\_Tayek](https://discuss.gradle.org/u/Ray_Tayek)\
**Post date:** [January 31, 2014, 4:49am UTC](https://discuss.gradle.org/t/how-do-i-create-a-local-maven-ivy-repository-and-fill-it/7106/1 "2014-01-31T04:49:00Z")

</div>

hi, i am going to give a presentation on gradle, but there is no internet access.

is it possible to make a local repository and fill it with what i will need?

thanks

---

<div class="post-metadata">

**Author:** ![Perryn\_Fowler](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@Perryn\_Fowler](https://discuss.gradle.org/u/Perryn_Fowler)\
**Post date:** [January 31, 2014, 6:37am UTC](https://discuss.gradle.org/t/how-do-i-create-a-local-maven-ivy-repository-and-fill-it/7106/2 "2014-01-31T06:37:00Z")

</div>

The simplest approach might be to use a flat directory resolver

[http://www.gradle.org/docs/current/userguide/dependency\_management.html#sec:flat\_dir\_resolver](http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:flat_dir_resolver)

---

<div class="post-metadata">

**Author:** ![bmuschko](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/bmuschko/32/5458_2.png) [@bmuschko](https://discuss.gradle.org/u/bmuschko)\
**Post date:** [January 31, 2014, 12:52pm UTC](https://discuss.gradle.org/t/how-do-i-create-a-local-maven-ivy-repository-and-fill-it/7106/3 "2014-01-31T12:52:00Z")

</div>

I’d probably just try to exercise all tasks you are planning to run during the presentation from home. That would resolve all required dependencies. After that you can run your build with the [–offline](http://www.gradle.org/docs/current/userguide/userguide_single.html#sec:cache_command_line_options) flag. Another option would be to simply record the demos and show the videos during the presentation.

---

<div class="post-metadata">

**Author:** ![Ray\_Tayek](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/ray_tayek/32/4985_2.png) [@Ray\_Tayek](https://discuss.gradle.org/u/Ray_Tayek)\
**Post date:** [January 31, 2014, 4:38pm UTC](https://discuss.gradle.org/t/how-do-i-create-a-local-maven-ivy-repository-and-fill-it/7106/4 "2014-01-31T16:38:00Z")

</div>

how would i populate it initially?

---

<div class="post-metadata">

**Author:** ![Ray\_Tayek](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/ray_tayek/32/4985_2.png) [@Ray\_Tayek](https://discuss.gradle.org/u/Ray_Tayek)\
**Post date:** [January 31, 2014, 4:41pm UTC](https://discuss.gradle.org/t/how-do-i-create-a-local-maven-ivy-repository-and-fill-it/7106/5 "2014-01-31T16:41:00Z")

</div>

that would work for me. but i was hoping to allow people in the audience to run the code examples. can i copy the caches? are they in ~/.gradle and ~/.m2?

---

<div class="post-metadata">

**Author:** ![bmuschko](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/bmuschko/32/5458_2.png) [@bmuschko](https://discuss.gradle.org/u/bmuschko)\
**Post date:** [January 31, 2014, 5:57pm UTC](https://discuss.gradle.org/t/how-do-i-create-a-local-maven-ivy-repository-and-fill-it/7106/6 "2014-01-31T17:57:00Z")

</div>

That would be ‘~/.gradle’.

---

<div class="post-metadata">

**Author:** ![bmuschko](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/bmuschko/32/5458_2.png) [@bmuschko](https://discuss.gradle.org/u/bmuschko)\
**Post date:** [January 31, 2014, 5:58pm UTC](https://discuss.gradle.org/t/how-do-i-create-a-local-maven-ivy-repository-and-fill-it/7106/7 "2014-01-31T17:58:00Z")

</div>

I’d write a task of type ‘Copy’ that uses the relevant configuration to download all dependencies to a directory. I am sure you’ll find many examples in the forum.

---

<div class="post-metadata">

**Author:** ![Schalk\_Cronje](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/schalk_cronje/32/6511_2.png) [@Schalk\_Cronje](https://discuss.gradle.org/u/Schalk_Cronje)\
**Post date:** [November 27, 2014, 9:56pm UTC](https://discuss.gradle.org/t/how-do-i-create-a-local-maven-ivy-repository-and-fill-it/7106/8 "2014-11-27T21:56:00Z")

</div>

Here is an example of doing it for unitests

[https://gist.github.com/ysb33r/6245ce9bef040bd7930f](https://gist.github.com/ysb33r/6245ce9bef040bd7930f)
