Is ti possible to have a `java_binary` target that embeds a specific subset of dependencies into the jar?

Viewed 53

The Bazel java_binary rule has an implicit output target of name_deploy.jar, which includes all dependencies into the jar. However, I'd like to include some but not all of the dependencies inside the jar.

Is there a way to specify some dependencies but not others to be embedded?

I've looked through the other options but none of them look like they were designed for this. I also asked this question to see if there's a way to observe what the implicit rule is doing.

1 Answers

The deploy_env attribute of java_binary allows the dependencies of another java_binary target to be removed from the runtime class path and deploy jar.

Related