Closed plaird closed 3 years ago
should the springboot rule also exposes only runtime_deps instead of deps?
@yishanhe are you consuming the output of springboot rule somehow in other java_* rules? for us, the springboot rule is always a terminal node in the dependency graph, aside from docker rules. Since the springboot rule outputs a self-contained jar with all the dependencies contained within, I don't think there is a use case where it needs to expose deps or runtime_deps to downstream rules?
@plaird , Thank you for your explanation, and it is great to see this one gets improved.
A follow-up question, would it be clear if we put the deps in this way
java_library(
name = "helloworld_lib",
srcs = glob(["src/main/java/**/*.java"]),
resources = glob(["src/main/resources/**"]),
deps = lib_deps,
runtime_deps = springboot_deps,
)
springboot(
name = "helloworld",
boot_app_class = "com.sample.SampleMain",
java_library = ":helloworld_lib",
# NO DEPS NEED TO BE DECLARED HERE
)
Thanks
Yes, I can add the comment to the example, that will make it more clear. Thanks for the feedback.
Given my base lib definition here:
I have to construct the deps attribute for my springboot rule invocation like this:
I shouldn't have to provide the deps or runtime_deps in the deps attribute, the rule should do that automatically.