Maven, Gradle: emit DependenciesDeclared table from FindDependency#7530
Merged
Maven, Gradle: emit DependenciesDeclared table from FindDependency#7530
DependenciesDeclared table from FindDependency#7530Conversation
Adds a new shared DependenciesDeclared data table in org.openrewrite.maven.table. Both rewrite-maven and rewrite-gradle FindDependency recipes populate it alongside the existing SearchResult markers, one row per declared dependency match. Schema mirrors DependenciesInUse minus the count column (every row is direct by construction). Single shared class follows the existing precedent: rewrite-gradle already imports org.openrewrite.maven.table.DependenciesInUse from rewrite-maven.
# Conflicts: # rewrite-gradle/src/main/resources/META-INF/rewrite/recipes.csv # rewrite-maven/src/main/resources/META-INF/rewrite/recipes.csv
Re-applies the recipes.csv updates that were lost during the merge from main, so the catalog reflects the DependenciesDeclared data table now emitted by both FindDependency recipes.
sambsnyd
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
org.openrewrite.maven.table.DependenciesDeclareddata table.rewrite-mavenandrewrite-gradleFindDependencyrecipes to emit one row per declared (direct) dependency match, alongside the existingSearchResultmarkers.DependenciesInUseminus thecountcolumn (always 1 by construction).Why
FindDependencywas the only "declared/direct only" search recipe without a data table — theDependencyInsightfamily already follows the Find emits SearchMarkers AND DataTables convention. Consumers wanting a clean, transitive-free list of declared coordinates currently have to either filterDependenciesInUse(which has noisDirectcolumn) or live without table output.A new table (rather than reusing
DependenciesInUsewithcount = 1) keeps the existing table's "direct + transitive" contract intact and lets pipelines that run bothDependencyInsightandFindDependencykeep their row sets disambiguated by table identity.Test plan
./gradlew :rewrite-maven:test --tests "*FindDependencyTest*"(11/11 green; new tests assert row content, scope defaulting tocompile, declared<scope>propagation, and that the table only sees declared coordinates)./gradlew :rewrite-gradle:test --tests "*FindDependencyTest*"(green; new tests assert row content for Groovy DSL and Kotlin DSL viawithToolingApi())./gradlew :rewrite-maven:licenseFormat :rewrite-gradle:licenseFormat(UP-TO-DATE)./gradlew :rewrite-maven:recipeCsvValidate :rewrite-gradle:recipeCsvValidate(content + completeness pass;recipes.csvregenerated to include the newdataTablesentry)