Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.


Repository files navigation


This project provides support for easily depending on common Android libraries in Bazel.

It hosts gmaven.bzl, a file containing external repository targets for all artifacts in Google Maven Repository plus their dependencies, and the supporting tools for generating it.

This project is an interim solution until Google Maven and AAR support is added to bazel-deps. See also Bazel External Deps Roadmap.

Usage instructions

Please see the releases page for instructions on using the latest snapshot.

To use this from your project, in your WORKSPACE file add

# Google Maven Repository
GMAVEN_TAG = "20180607-1" # or the tag from the latest release

    name = "gmaven_rules",
    strip_prefix = "gmaven_rules-%s" % GMAVEN_TAG,
    url = "" % GMAVEN_TAG,

load("@gmaven_rules//:gmaven.bzl", "gmaven_rules")


You can then reference the generated library targets from your BUILD files like:

load("@gmaven_rules//:defs.bzl", "gmaven_artifact")
    deps = [

You can see the full list of generated targets in gmaven.bzl.

Updating gmaven.bzl

To update gmaven.bzl, run the following command. It will take about 3 minutes.

bazel run //:gmaven_to_bazel && cp bazel-bin/gmaven_to_bazel.runfiles/__main__/gmaven.bzl .

Known issues

Currently, cross-repository dependency resolution is not supported. Some of the artifacts depend on other artifacts that are not present on Google Maven, and these missing dependencies are silently ignored and may cause failures at runtime.