Skip to content

Commit 04e46bb

Browse files
authored
Datatable should not have the direct column (#5607)
1 parent 18a8172 commit 04e46bb

File tree

4 files changed

+2
-15
lines changed

4 files changed

+2
-15
lines changed

rewrite-gradle/src/main/java/org/openrewrite/gradle/search/DependencyInsight.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ public Tree visit(@Nullable Tree tree, ExecutionContext ctx) {
159159
dep.getVersion(),
160160
dep.getDatedSnapshotVersion(),
161161
dep.getRequested().getScope(),
162-
dep.getDepth(),
163-
resolvedDependency.getGav().asGroupArtifactVersion()
162+
dep.getDepth()
164163
));
165164
}
166165
}

rewrite-gradle/src/test/java/org/openrewrite/gradle/search/DependencyInsightTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,9 @@ void nestedDependenciesAreTransitivelySearchedForMatchingDependencies() {
259259
DependenciesInUse.Row row = rows.getFirst();
260260
assertThat(row.getArtifactId()).isEqualTo("spring-boot-starter-web");
261261
assertThat(row.getDepth()).isEqualTo(0);
262-
assertThat(row.getDirect()).isNotNull().hasToString("org.springframework.boot:spring-boot-starter-web:2.6.6");
263262
row = rows.get(4);
264263
assertThat(row.getArtifactId()).isEqualTo("spring-boot");
265264
assertThat(row.getDepth()).isEqualTo(4);
266-
assertThat(row.getDirect()).isNotNull().hasToString("org.springframework.boot:spring-boot-starter-web:2.6.6");
267265
}),
268266
buildGradle(
269267
"""
@@ -340,12 +338,10 @@ void jacksonIsFoundInternally() {
340338
assertThat(row.getGroupId()).isEqualTo("com.fasterxml.jackson.datatype");
341339
assertThat(row.getArtifactId()).isEqualTo("jackson-datatype-jsr310");
342340
assertThat(row.getDepth()).isEqualTo(2);
343-
assertThat(row.getDirect()).isNotNull().hasToString("org.springframework.boot:spring-boot-starter-web:2.6.6");
344341
row = rows.get(4);
345342
assertThat(row.getGroupId()).isEqualTo("com.fasterxml.jackson.core");
346343
assertThat(row.getArtifactId()).isEqualTo("jackson-core");
347344
assertThat(row.getDepth()).isEqualTo(3);
348-
assertThat(row.getDirect()).isNotNull().hasToString("org.springframework.boot:spring-boot-starter-web:2.6.6");
349345
}),
350346
buildGradle(
351347
"""

rewrite-maven/src/main/java/org/openrewrite/maven/search/DependencyInsight.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) {
156156
match.getDatedSnapshotVersion(),
157157
StringUtils.isBlank(match.getRequested().getScope()) ? "compile" :
158158
match.getRequested().getScope(),
159-
match.getDepth(),
160-
null
159+
match.getDepth()
161160
));
162161

163162
return t;

rewrite-maven/src/main/java/org/openrewrite/maven/table/DependenciesInUse.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.openrewrite.Column;
2222
import org.openrewrite.DataTable;
2323
import org.openrewrite.Recipe;
24-
import org.openrewrite.maven.tree.GroupArtifactVersion;
2524

2625
@JsonIgnoreType
2726
public class DependenciesInUse extends DataTable<DependenciesInUse.Row> {
@@ -65,11 +64,5 @@ public static class Row {
6564
@Column(displayName = "Depth",
6665
description = "How many levels removed from a direct dependency. This will be 0 for direct dependencies.")
6766
Integer depth;
68-
69-
@Column(displayName = "Direct dependency",
70-
description = "What dependency brings this dependency to the project. If depth is 0, this will be the same as the detected dependency. " +
71-
"Only for gradle dependencies")
72-
@Nullable
73-
GroupArtifactVersion direct;
7467
}
7568
}

0 commit comments

Comments
 (0)