Skip to content

Repository files navigation

Scanned by Frogbot Test

🐘 Gradle Dependency Tree

This Gradle plugin reads the Gradle dependencies of a given Gradle project, and generates a dependency tree. This package was developed by JFrog, and is used by the JFrog IntelliJ IDEA Plugin to generate the dependency tree for projects using Gradle dependencies. You may find this plugin useful for other purposes and applications as well, by applying it in your build.gradle file.

🖥️ Usage

Inject the plugin using the init.gradle initialization script, and run generateDepTrees in a directory containing a build.gradle file. The plugin will generate a dependency tree for each subproject that does not contain a build.gradle file. To generate a dependency tree for each subproject that contains a Gradle build file, set the -Dcom.jfrog.includeAllBuildFiles flag to true.

To skip Gradle configurations whose names match a regex, set -Dcom.jfrog.excludeConfigurationsPattern=<regex>. For example, to skip names containing test case-insensitively (including testImplementation, androidTest*, and also testFixtures* / accidental substring hits like latestReleaseApi):

gradle clean generateDepTrees -I <path/to/init.gradle> -q \
  -Dcom.jfrog.depsTreeOutputFile=<path/to/output/file> \
  -Dcom.jfrog.excludeConfigurationsPattern=(?i)test

If the property is omitted or blank, all configurations are included. Invalid regex fails the task.

The command:

gradle clean generateDepTrees -I <path/to/init.gradle> -q -Dcom.jfrog.depsTreeOutputFile=<path/to/output/file>

Output:

"<path/to/dependency/tree1>"
"<path/to/dependency/tree2>"
...

🌲 Output Tree Structure

{
  "root": "org.jfrog.example.gradle:shared:1.0-SNAPSHOT",
  "nodes": {
    "junit:junit:4.7": {
      "unresolved": false,
      "configurations": ["testCompileClasspath", "testImplementation", "testRuntimeClasspath"],
      "types": ["jar"],
      "children": []
    },
    "org.jfrog.example.gradle:shared:1.0-SNAPSHOT": {
      "unresolved": false,
      "configurations": ["compileClasspath", "runtimeClasspath", "testCompileClasspath", "testRuntimeClasspath"],
      "types": [],
      "children": ["junit:junit:4.7"]
    }
  }
}

types lists the artifact type(s) a dependency resolved as ("jar", or "pom" for a BOM). May be empty if undetermined. Downstream consumers should ignore unrecognized values.

💻 Contributions

We welcome pull requests from the community. To help us improve this project, please read our contribution guide.

About

Gradle plugin that reads the Gradle dependencies of a given Gradle project, and generates a dependency tree.

Topics

Resources

Contributing

Security policy

Stars

15 stars

Watchers

3 watching

Forks

Releases

Used by

Contributors

Languages