# Adding a Gradle repository for "Add Reference" dialog

**URL:** https://talk.remobjects.com/t/adding-a-gradle-repository-for-add-reference-dialog/18302
**Category:** Oxygene
**Tags:** water
**Created:** [January 1, 2019, 3:14pm UTC](https://talk.remobjects.com/t/adding-a-gradle-repository-for-add-reference-dialog/18302 "2019-01-01T15:14:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![zmattr](https://talk.remobjects.com/user_avatar/talk.remobjects.com/zmattr/32/7989_2.png) [@zmattr](https://talk.remobjects.com/u/zmattr)
#### Post date: [January 1, 2019, 3:14pm UTC](https://talk.remobjects.com/t/adding-a-gradle-repository-for-add-reference-dialog/18302/1 "2019-01-01T15:14:01Z")

</div>

How do I add a Gradle repository in such a way that the “Add Reference” dialog in Water can use it? Specifically, I’m trying to add Google’s maven repository:

```
<GradleRepository Include="https://maven.google.com/" />

```

If I add the above line to my project config file directly, I don’t seem to get the massive benefit of pulling in recursive dependencies (that seems to be a feature of the “Add Reference” dialog rather than a build-time feature – please correct me if I’m wrong). Also when I add it to my project config file, I still don’t see the repo’s libraries in the “Add Reference” dialog.

Is there any way to add a repository for the “Add Reference” dialog to display?

(Incidentally, it would be nice to have Google’s maven repo added by default for Android projects, as Android Studio now includes it by default and Google hosts a lot of their core libraries here now).

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [January 1, 2019, 8:03pm UTC](https://talk.remobjects.com/t/adding-a-gradle-repository-for-add-reference-dialog/18302/2 "2019-01-01T20:03:42Z")

</div>

Matt,

> [@zmattr](#):
>
> How do I add a Gradle repository in such a way that the “Add Reference” dialog in Water can use it? Specifically, I’m trying to add Google’s maven repository:

I’m afraid right now you can’t. The dialog only supports the standard local file based repositories because, frankly, supporting remoter repositories of the size of the Gradle and NuGet ones requires me to rethink the UI for his to best integrate incremental searching for packages by names that are not shown in a flat list (as there’d be too many to download the whole list efficiently). That’s on my list, but I just haven’t gotten around to it yet :(.

> [@zmattr](#):
>
> If I add the above line to my project config file directly, I don’t seem to get the massive benefit of pulling in recursive dependencies (that seems to be a feature of the “Add Reference” dialog rather than a build-time feature – please correct me if I’m wrong).

The GradleRepository tag in the project only affects build time (and in-IDE referent resolving), yes. Packages in that repository that your project already has a reference to will be found _in_ that repository, both when building and when working in the IDE.

Once the above is implemented, the repository would of course also contribute to what’s shown in the dialog.

> [@zmattr](#):
>
> Is there any way to add a repository for the “Add Reference” dialog to display?

Right now, in additional to not working for http:// based repositories but only local ones, the list of repositories used is hardcoded in EBuild, with `<GradleRepository>` being the only way to add custom ones, on a per-project basis. Since he Manage References dialog doesn’t support https:// repositories yet, making that list configurable was a low priority (but is of course on the list).

> [@zmattr](#):
>
> (Incidentally, it would be nice to have Google’s maven repo added by default for Android projects, as Android Studio now includes it by default and Google hosts a lot of their core libraries here now).

It is. These three repositories ar reconfigured by default, plus any local `m2repository` repository folders in there Android SDK install:

- [https://maven.google.com](https://maven.google.com)
- [Central Repository:](https://repo1.maven.org/maven2)
- [https://jcenter.bintray.com](https://jcenter.bintray.com)

—marc

---

<div class="post-metadata">

### Author: ![zmattr](https://talk.remobjects.com/user_avatar/talk.remobjects.com/zmattr/32/7989_2.png) [@zmattr](https://talk.remobjects.com/u/zmattr)
#### Post date: [January 1, 2019, 8:13pm UTC](https://talk.remobjects.com/t/adding-a-gradle-repository-for-add-reference-dialog/18302/3 "2019-01-01T20:13:17Z")

</div>

> [@mh](#):
>
> That’s on my list

I know the feeling 🙂 Looking forward to this feature being added, as I’m really appreciating having Gradle reference support!

> [@mh](#):
>
> These three repositories ar reconfigured by default

Thanks, good to know. Seems like the documentation on [Package References](https://docs.elementscompiler.com/Projects/References/PackageReferences/) needs to be updated then:

## Repositories

… For Android, that are `jcenter.bintray.com` and `repo1.maven.org/maven2` , as well as any local repositories in disk in the `extras` folder of the Android SDK install.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [January 2, 2019, 12:25pm UTC](https://talk.remobjects.com/t/adding-a-gradle-repository-for-add-reference-dialog/18302/4 "2019-01-02T12:25:14Z")

</div>

> [@zmattr](#):
>
> Thanks, good to know. Seems like the documentation on [Package References](https://docs.elementscompiler.com/Projects/References/PackageReferences/) needs to be updated then:

Oops, indeed. done.
