Reputation: 1
I want to migrate a maven project to Bazel. In maven, I have some dependencies declared as provided
. It means the dependency is used to compile but is not shipped in the final jar.
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>${spark.version}</version>
<scope>provided</scope>
</dependency>
Is there a way to declare dependencies as provided
in Bazel for a java binary that are not in the _deploy.jar
?
Upvotes: 0
Views: 317
Reputation: 33436
I believe you are looking for compile-only dependencies provided by rules_jvm_external.
load("@rules_jvm_external//:specs.bzl", "maven")
maven_install(
artifacts = [
maven.artifact("org.apache.spark", "spark-core_2.11", "<spark.version>", neverlink = True),
],
)
Upvotes: 1