Installing Maven artifact with dependencies

I’m trying to create a shell.nix to ease the process of experimenting with webgraph. My goal is to create a derivation which downloads a specific JAR from the maven repository along with its dependencies. As of now I don’t know how to get the dependencies without listing them by hand.

let webgraph =
  javaPackages.fetchMaven {
    groupId = "it.unimi.dsi";
    artifactId = "webgraph";
    version = "3.6.10";
    sha512 = "...";
  }; in
...

This works but has two problems:

  • Doesn’t automatically add the jar to the CLASSPATH
  • It does not download the dependencies
    Is this something that can be done easily with the current available tools?

Thanks