Skip to main content

Dependency report

org.openrewrite.java.dependencies.DependencyList

Emits a data table detailing all Gradle and Maven dependencies. This recipe makes no changes to any source file.

Recipe source

GitHub, Issue Tracker, Maven Central

This recipe is available under the Apache License Version 2.0.

Options

TypeNameDescriptionExample
ScopescopeOptional. The scope of the dependencies to include in the report.Defaults to "Compile" Valid options: Compile, Runtime, TestRuntimeCompile
booleanincludeTransitiveOptional. Whether or not to include transitive dependencies in the report. Defaults to including only direct dependencies.Defaults to false.true
booleanvalidateResolvableOptional. When enabled the recipe will attempt to download every dependency it encounters, reporting on any failures. This can be useful for identifying dependencies that have become unavailable since an LST was produced.Defaults to false. Valid options: true, falsetrue

Usage

This recipe has no required configuration options. It can be activated by adding a dependency on org.openrewrite.recipe:rewrite-java-dependencies in your build file or by running a shell command (in which case no build changes are needed):

  1. Add the following to your build.gradle file:
build.gradle
plugins {
id("org.openrewrite.rewrite") version("7.5.0")
}

rewrite {
activeRecipe("org.openrewrite.java.dependencies.DependencyList")
setExportDatatables(true)
}

repositories {
mavenCentral()
}

dependencies {
rewrite("org.openrewrite.recipe:rewrite-java-dependencies:1.33.0")
}
  1. Run gradle rewriteRun to run the recipe.

See how this recipe works across multiple open-source repositories

Run this recipe on OSS repos at scale with the Moderne SaaS.

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.

Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.

Data Tables

Dependency report

org.openrewrite.java.dependencies.table.DependencyListReport

Lists all Gradle and Maven dependencies

Column NameDescription
Build toolThe build tool used to manage dependencies (Gradle or Maven).
Group idThe Group ID of the Gradle project or Maven module requesting the dependency.
Artifact idThe Artifact ID of the Gradle project or Maven module requesting the dependency.
VersionThe version of Gradle project or Maven module requesting the dependency.
Dependency group idThe Group ID of the dependency.
Dependency artifact idThe Artifact ID of the dependency.
Dependency versionThe version of the dependency.
Direct DependencyWhen true the project directly depends on the dependency. When false the project depends on the dependency transitively through at least one direct dependency.
Resolution failureThe reason why the dependency could not be resolved. Blank when resolution was not attempted.

Contributors

Sam Snyder, Kun Li, Jonathan Schnéider, Tim te Beek