@@ -57,11 +57,6 @@ public class JmhMojo extends AbstractMojo {
5757 public static final String CLASSPATH_ARG = "-cp" ;
5858 public static final String JAR_TYPE = "jar" ;
5959
60- /**
61- * If true benchmarks in test scope will be executed (Java classes of benchmarks must be placed under
62- * {@code src/main/java}).
63- */
64- private boolean benchmarksInTestScope = false ;
6560
6661 @ Parameter (defaultValue = "${project}" , readonly = true )
6762 private MavenProject project ;
@@ -72,6 +67,13 @@ public class JmhMojo extends AbstractMojo {
7267 @ Parameter (defaultValue = "true" )
7368 private boolean writeToFile ;
7469
70+ /**
71+ * If true benchmarks in test scope will be executed (Java classes of benchmarks must be placed under
72+ * {@code src/test/java}).
73+ */
74+ @ Parameter (defaultValue = "true" )
75+ private boolean testScope ;
76+
7577 @ Parameter (defaultValue = "${project.build.directory}/jmh-results.json" )
7678 private String file ;
7779
@@ -157,7 +159,7 @@ private List<String> getClasspathForBenchmarkRun() throws DependencyResolutionRe
157159
158160 final List <String > classpath = new ArrayList <>();
159161 classpath .addAll (project .getRuntimeClasspathElements ());
160- if (benchmarksInTestScope ) {
162+ if (testScope ) {
161163 classpath .addAll (project .getTestClasspathElements ());
162164 }
163165 classpath .addAll (dependencies );
@@ -289,7 +291,7 @@ private List<String> resolveArtifact(@NonNull final String groupId, @NonNull fin
289291 */
290292 @ NonNull
291293 private File getBenchmarkList () {
292- if (benchmarksInTestScope ) {
294+ if (testScope ) {
293295 return new File (new File (project .getBuild ().getTestOutputDirectory (), META_INF ),
294296 BENCHMARK_LIST_FILE );
295297 } else {
0 commit comments