package org.jbehave.mojo;

import java.util.List;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;

/**
 * Mojo to run scenarios
 * 
 * @author Mauro Talevi
 * @goal run-scenarios
 */
public class ScenarioRunnerMojo extends AbstractJBehaveMojo {

    /**
     * Scenario class names
     * 
     * @parameter
     */
    private List<String> scenarioClassNames;

    public void execute() throws MojoExecutionException, MojoFailureException {
        List<String> scenarios = scenarioClassNames;
        if ( scenarios == null || scenarios.isEmpty() ){
            scenarios = findScenarioClassNames();
        }
        for (String scenario : scenarios) {
            try {
                getLog().info("Running scenario "+scenario);
                createScenarioClassLoader().newScenario(scenario).runUsingSteps();
            } catch (Throwable e) {
                throw new MojoExecutionException("Failed to run scenario " + scenario, e);
            }
        }
    }

}

@@ -561,17 +561,16 @@
     if (
- 
 scenario
@@ -605,10 +605,10 @@
 ty()
- 
 )
+ 
 %7B%0A  
@@ -657,32 +657,139 @@
 es();%0A        %7D%0A
+        if (scenarios.isEmpty()) %7B%0A            getLog().info(%22No scenarios to run.%22);%0A        %7D else %7B%0A    
         for (Str
@@ -812,24 +812,28 @@
 cenarios) %7B%0A
+    
             
@@ -846,32 +846,36 @@
                 
+    
 getLog().info(%22R
@@ -891,17 +891,19 @@
 enario %22
-+
+ + 
 scenario
@@ -905,16 +905,20 @@
 nario);%0A
+    
         
@@ -1004,16 +1004,20 @@
         
+    
 %7D catch 
@@ -1028,24 +1028,28 @@
 owable e) %7B%0A
+    
             
@@ -1127,16 +1127,34 @@
 io, e);%0A
+                %7D%0A
         

Add log message when no scenario are found.