bazelbuild / migration-tooling

Migration tools for Bazel
Apache License 2.0
44 stars 30 forks source link

transitive_maven_jar does not get triggered #92

Open haikalpribadi opened 5 years ago

haikalpribadi commented 5 years ago

Hi everyone,

I've been trying to get transitive_maven_jar rule to work, but fail to get it triggered at all.

I have run generate_workspace and produced stored the output in dependencies.bzl in the workspace root directory. I have confirmed that this works fine.

Now I've extend the WORKSPACE with the transitive_maven_jar rule, such as the following:

http_archive(
    name = "trans_maven_jar",
    url = "https://github.com/bazelbuild/migration-tooling/archive/master.zip",
    type = "zip",
    strip_prefix = "migration-tooling-master",
)

load("@trans_maven_jar//transitive_maven_jar:transitive_maven_jar.bzl", "transitive_maven_jar")

transitive_maven_jar(
    name = "dependencies",
    artifacts = [
                "org.apache.spark:spark-core_2.10:1.6.1",
                ...
    ]
)

load("//:dependencies.bzl", "generated_maven_jars")
generated_maven_jars()

However, when I run bazel build //some-package, it builds some-package and no signe of the transitive_maven_jar being evaluated.

I then update it with a new artifact:

transitive_maven_jar(
    name = "dependencies",
    artifacts = [
                "org.apache.spark:spark-core_2.10:1.6.1",
                "org.apache.spark:spark-mllib_2.10::2.2.2", # the new artifact
                ...
    ]
)

And still no sign of the transitive_maven_jar being evaluated during build time. I'm expecting to see a newly generated generate_workspace.bzl as the docs said, but nothing happens.

I'm new to bazel. Am I doing something wrong? How do I get the transitive_maven_jar to produce a new generated_workspace.bzl?

Thank you!