bazelbuild / migration-tooling

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

generate_workspace doesn't include runtime dependencies of maven artifact #32

Open petroseskinder opened 7 years ago

petroseskinder commented 7 years ago

Migrated from issue 2316 in main repository

example: bazel run //src/tools/generate_workspace -- --artifact=org.mockito:mockito-core:2.4.2

mockito-core has 4 runtime dependencies, none were generated.

I believe the cause of this issue is this line in the Maven Resolver:

public Model resolveEffectiveModel(ModelSource modelSource, Set<String> exclusions, Rule parent) {
    Model model = modelResolver.getEffectiveModel(modelSource, handler);
    ...
    for (Dependency dependency : model.getDependencies()) {
      if (!dependency.getScope().equals(COMPILE_SCOPE)) {
        continue;
      }
    ...
    }

Any maven dependencies that aren't scoped for compile time are ignored.