diff --git a/src/main/java/org/openrewrite/maven/RewriteDiscoverMojo.java b/src/main/java/org/openrewrite/maven/RewriteDiscoverMojo.java index 69166664..be3b9acb 100644 --- a/src/main/java/org/openrewrite/maven/RewriteDiscoverMojo.java +++ b/src/main/java/org/openrewrite/maven/RewriteDiscoverMojo.java @@ -21,7 +21,7 @@ * {@code ./mvnw rewrite:discover -Ddetail=true -Drecipe=} to display recipe configuration details. For example:
* {@code ./mvnw rewrite:discover -Ddetail=true -Drecipe=org.openrewrite.java.format.AutoFormat} */ -@Mojo(name = "discover", threadSafe = true) +@Mojo(name = "discover", threadSafe = true, requiresProject = false, aggregator = true) @SuppressWarnings("unused") public class RewriteDiscoverMojo extends AbstractRewriteMojo { diff --git a/src/test/java/org/openrewrite/maven/RewriteDiscoverIT.java b/src/test/java/org/openrewrite/maven/RewriteDiscoverIT.java index 8d6cbaf9..4be16e81 100644 --- a/src/test/java/org/openrewrite/maven/RewriteDiscoverIT.java +++ b/src/test/java/org/openrewrite/maven/RewriteDiscoverIT.java @@ -78,4 +78,16 @@ void rewrite_discover_rewrite_yml(MavenExecutionResult result) { assertThat(result).out().warn().isEmpty(); } + @MavenTest + void rewrite_discover_multi_module(MavenExecutionResult result) { + assertThat(result) + .isSuccessful() + .out() + .info() + .anySatisfy(line -> assertThat(line).matches("^a.*SKIPPED$")) + .anySatisfy(line -> assertThat(line).matches("^b.*SKIPPED$")); + + assertThat(result).out().warn().isEmpty(); + } + } diff --git a/src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_multi_module/a/pom.xml b/src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_multi_module/a/pom.xml new file mode 100644 index 00000000..f78b003c --- /dev/null +++ b/src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_multi_module/a/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + + org.openrewrite.maven + rewrite_discover_multi_module + 1.0 + + + a + + diff --git a/src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_multi_module/b/pom.xml b/src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_multi_module/b/pom.xml new file mode 100644 index 00000000..e1d02c7b --- /dev/null +++ b/src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_multi_module/b/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + + org.openrewrite.maven + rewrite_discover_multi_module + 1.0 + + + b + + diff --git a/src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_multi_module/pom.xml b/src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_multi_module/pom.xml new file mode 100644 index 00000000..a24939ce --- /dev/null +++ b/src/test/resources-its/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_multi_module/pom.xml @@ -0,0 +1,31 @@ + + + 4.0.0 + + org.openrewrite.maven + rewrite_discover_multi_module + 1.0 + pom + RewriteDiscoverIT#multi_module + + + a + b + + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + ${project.build.directory}/maven-it/org/openrewrite/maven/RewriteDiscoverIT/rewrite_discover_multi_module/project/target/pomCache + + + + + +