bazel-contrib / bazel-contrib/rules_jvm_external

Feature request: maven dependency tree

Open
#499 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
373
Forks
301
Avg merge
7d 17h
Merged PRs (30d)
3

Description

Hello!
Apologies if this isn't the best forum for feature requests, but wanted thoughts/opinions on adding an analog to mvn dependency:tree as a rule.

I believe this should be possible via the maven_coordinates tag that gets added to each dependency and think I see path forward looking at the code in pom_file.bzl.

We are scanning maven dependencies for vulnerabilities with Snyk, but sometimes it's difficult to determine what maven artifact is providing the transitive dependency on an out-of-date library. Currently the easiest approach is to run the java_export rule and create a POM file, then run mvn dependency:tree on that pom file to visually see the Maven artifact versions and dependencies.

Would it be possible to add a pure Starlark rule that creates and output similar to mvn dependency:tree that includes the maven coordinates and versions? I'm happy to take a stab at something too if you feel it is worthwhile. Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading pom_file.bzl and tracing how the maven_coordinates tag is added to dependencies and how java_export produces a POM file. Compare the available metadata with mvn dependency:tree, then define a pure Starlark rule whose output shows Maven coordinates, versions, and transitive relationships.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.