Comment on page
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.
- groupId: org.openrewrite.recipe
- artifactId: rewrite-java-dependencies
- version: 1.2.0
Type | Name | Description |
---|---|---|
Scope | scope | The scope of the dependencies to include in the report. |
boolean | includeTransitive | Whether or not to include transitive dependencies in the report. Defaults to including only direct dependencies. |
Lists all Gradle and Maven dependencies
Column Name | Description |
---|---|
Build tool | The build tool used to manage dependencies (Gradle or Maven). |
Group id | The Group ID of the Gradle project or Maven module requesting the dependency. |
Artifact id | The Artifact ID of the Gradle project or Maven module requesting the dependency. |
Version | The version of Gradle project or Maven module requesting the dependency. |
Dependency group id | The Group ID of the dependency. |
Dependency artifact id | The Artifact ID of the dependency. |
Dependency version | The version of the dependency. |
Direct Dependency | When true the project directly depends on the dependency. When false the project depends on the dependency transitively through at least one direct dependency. |
This recipe has required configuration parameters. Recipes with required configuration parameters cannot be activated directly. To activate this recipe you must create a new recipe which fills in the required parameters. In your
rewrite.yml
create a new recipe with a unique name. For example: com.yourorg.DependencyListExample
. Here's how you can define and customize such a recipe within your rewrite.yml:rewrite.yml
---
type: specs.openrewrite.org/v1beta/recipe
name: com.yourorg.DependencyListExample
displayName: Dependency report example
recipeList:
- org.openrewrite.java.dependencies.DependencyList:
scope: Compile
includeTransitive: false
Now that
com.yourorg.DependencyListExample
has been defined activate it and take a dependency on org.openrewrite.recipe:rewrite-java-dependencies:1.2.0 in your build file:Gradle
Maven
Moderne CLI
- 1.Add the following to your
build.gradle
file:
build.gradle
plugins {
id("org.openrewrite.rewrite") version("6.5.6")
}
rewrite {
activeRecipe("com.yourorg.DependencyListExample")
}
repositories {
mavenCentral()
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-java-dependencies:1.2.0")
}
- 2.Run
gradle rewriteRun
to run the recipe.
- 1.Add the following to your
pom.xml
file:
pom.xml
<project>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>5.13.0</version>
<configuration>
<activeRecipes>
<recipe>com.yourorg.DependencyListExample</recipe>
</activeRecipes>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-java-dependencies</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
- 2.Run
mvn rewrite:run
to run the recipe.
You will need to have configured the Moderne CLI on your machine before you can run the following command.
shell
mod run . --recipe DependencyList
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.
Last modified 9d ago