diff --git a/src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java b/src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java index c7183854..e76eaef7 100644 --- a/src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java +++ b/src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java @@ -474,7 +474,7 @@ private Set pathsToOtherMavenProjects(MavenProject mavenProject) { } private List maybeAutodetectStyles(List sourceFiles, @Nullable Iterable styles) { - if (styles != null) { + if (styles != null && styles.spliterator().getExactSizeIfKnown() > 0) { return sourceFiles; } Autodetect autodetect = Autodetect.detect(sourceFiles);