Cannot get JBehave metafilters to work from a mvn command line

admin

Administrator
Staff member
I have a series of JBehave tests that I run from the command line via

Code:
mvn integration-test

I am trying to decorate a subset of tests with a meta tag
Code:
SpecialPurpose
, which only get run on-demand:

Code:
Meta:
@SpecialPurpose

Scenario: Run this test only from the nightly build

Following <a href="https://stackoverflow.com/questions/11742151/filtering-with-multiple-metafilters-in-jbehave">Filtering with multiple metafilters in JBehave</a>, I try the following command line:

Code:
mvn integration-test -Djbehave.meta.filter="myCustomRunConf:(+SpecialPurpose)"

This runs all the tests in the suite. For completeness, I also tried

Code:
mvn integration-test -Djbehave.meta.filter="+SpecialPurpose"

and

Code:
mvn integration-test -Dmeta.filter="+SpecialPurpose"

as described at <a href="https://kowalcj0.wordpress.com/2013...s-tagged-with-multiple-words-in-a-meta-field/" rel="nofollow noreferrer">https://kowalcj0.wordpress.com/2013...s-tagged-with-multiple-words-in-a-meta-field/</a>. None of these appear to successfully filter.

And for completeness, the pom.xml segment related to JBehave is

Code:
  &lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;net.serenity-bdd.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;serenity-maven-plugin&lt;/artifactId&gt;
        &lt;version&gt;1.5.0&lt;/version&gt;
        &lt;executions&gt;
          &lt;execution&gt;
            &lt;id&gt;serenity-reports&lt;/id&gt;
            &lt;phase&gt;post-integration-test&lt;/phase&gt;
            &lt;goals&gt;
              &lt;goal&gt;aggregate&lt;/goal&gt;
            &lt;/goals&gt;
          &lt;/execution&gt;
        &lt;/executions&gt;
      &lt;/plugin&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
        &lt;executions&gt;
          &lt;execution&gt;
            &lt;id&gt;integration-test&lt;/id&gt;
            &lt;goals&gt;
              &lt;goal&gt;integration-test&lt;/goal&gt;
              &lt;goal&gt;verify&lt;/goal&gt;
            &lt;/goals&gt;
          &lt;/execution&gt;
        &lt;/executions&gt;
        &lt;configuration&gt;
          &lt;includes&gt;
            &lt;include&gt;**/integration/*.java&lt;/include&gt;
            &lt;include&gt;**/integration/component1/*.java&lt;/include&gt;
            &lt;include&gt;**/integration/component2/*.java&lt;/include&gt;
            &lt;include&gt;**/integration/component3/*.java&lt;/include&gt;
          &lt;/includes&gt;
          &lt;reuseForks&gt;false&lt;/reuseForks&gt;
          &lt;trimStackTrace&gt;false&lt;/trimStackTrace&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  &lt;/build&gt;

1) What is the proper syntax for decorating a story for inclusion?

2) What is the proper command-line?

3) Is there something unusual with the pom.xml definition that is intercepting or breaking the metafilter?