0

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 ?

1
  • 1
    What have you tried so far? java_library.deps may be the answer. Commented Jul 12, 2018 at 8:46

1 Answer 1

1

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),
    ],
)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.