Skip to content

Commit 5c941ae

Browse files
committed
OpenRewriteMavenBuildFile takes compile as default scope for dependencies if not set
1 parent a2a1ff5 commit 5c941ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/sbm-core/src/main/java/org/springframework/sbm/build/impl/OpenRewriteMavenBuildFile.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,10 @@ public List<Dependency> getDeclaredDependencies(Scope... scopes) {
233233
return true;
234234
} else {
235235
// FIXME: scope test should also return compile!
236-
return Arrays.asList(scopes).stream().anyMatch(scope -> scope.toString().equals(d.getScope()));
236+
return Arrays.asList(scopes).stream().anyMatch(scope -> {
237+
String effectiveScope = d.getScope() == null ? "compile" : d.getScope();
238+
return scope.toString().equalsIgnoreCase(effectiveScope);
239+
});
237240
}
238241
})
239242
.map(d -> mapDependency(d))

0 commit comments

Comments
 (0)