Skip to content
This repository was archived by the owner on Jun 14, 2024. It is now read-only.

java_import_external #11

Open
jart opened this issue Mar 14, 2017 · 1 comment
Open

java_import_external #11

jart opened this issue Mar 14, 2017 · 1 comment

Comments

@jart
Copy link

jart commented Mar 14, 2017

@ekuefler, you may recall bazelbuild/bazel#1952 where we had a discussion about best practices for defining Maven dependencies.

With your approval, I would like to volunteer my time to migrate this project to what seems to be the emerging consensus. That would entail modifying gwt/gwt.bzl to use java_import_external.

List of Converted Projects

Benefits of Migration

  1. Faster downloads, redundant URLs, connection retries, exponential backoff, connection reset recovery, fast failover, auto-avoidance of low-bandwidth mirrors, captive portal avoidance, and compliance with policies of certain great firewalls. See: bazelbuild/bazel@ed7ced0

  2. Shorter names. You can say deps = ["@com_google_guava"] instead of deps = ["@com_google_guava//jar"].

  3. Dependency relationships are encoded into repositories. If you want //external:gwt_jetty you currently need to depend on //external:gwt_jetty AND //external:gwt_jetty-io AND //external:gwt_jetty-util because maven_jar didn't let you specify that jetty depended on those jars. With java_import_external, if you want jetty, you just depend on jetty.

  4. Ability to set testonly = 1 which maven_jar doesn't do.

  5. Ability to set licenses = ["notice"], etc. which maven_jar doesn't do.

  6. Ability to define annotation processors. See Dagger example here.

If you find the technical merits of these developments compelling, let me know, and I'll move forward.

Side note: I have another cool repository rule I've developed called filegroup_external (source) which you may also find interesting. I'd love to hear your thoughts.

@ekuefler
Copy link
Contributor

Go for it! Glad to here there's growing consensus here and the new rules look pretty slick. I'm not overly happy with the current state of the GWT dependencies, so feel free to modify them however you think would make the most sense (and update instructions in the README accordingly).

Thanks for all your work figuring out best practices here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants