migration-tooling icon indicating copy to clipboard operation
migration-tooling copied to clipboard

generate_workspace doesn't include runtime dependencies of maven artifact

Open petroseskinder opened this issue 8 years ago • 0 comments
trafficstars

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.

petroseskinder avatar Jun 19 '17 22:06 petroseskinder