"Provided" scope in bazel

611 views
Skip to first unread message

ittai zeidman

unread,
Aug 30, 2016, 1:58:25 PM8/30/16
to bazel-discuss
Hi,
How do I simulate the maven "provided" scope in Bazel? Provided means I can compile with it but it doesn't get packaged in the end deployable (and it's not transitive)

Thanks!

Alex Humesky

unread,
Aug 30, 2016, 2:12:27 PM8/30/16
to ittai zeidman, bazel-discuss
If this for the java rules, you can accomplish this by creating a neverlink version of the dependency and depending on that:

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/2d315cb0-f0a1-470a-be4a-4e0e81810ca9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ittai zeidman

unread,
Aug 30, 2016, 2:55:49 PM8/30/16
to Alex Humesky, bazel-discuss
Sounds exactly like what I need, thanks!

david.o...@gmail.com

unread,
Aug 31, 2016, 3:49:47 AM8/31/16
to bazel-discuss, itt...@gmail.com
Am Dienstag, 30. August 2016 20:12:27 UTC+2 schrieb Alex Humesky:
> If this for the java rules, you can accomplish this by creating a neverlink version of the dependency and depending on that:
> https://www.bazel.io/versions/master/docs/be/java.html#java_library.neverlink

never link is added to nodes in the dependency graph. In some cases you want
this attribute to be added to the edges and not to the nodes. That why there is
a feature request to add provided_deps attribute to the java_library rule: [1].

[1] https://github.com/bazelbuild/bazel/issues/1402

Reply all
Reply to author
Forward
0 new messages