Search code examples
maventestingjmeterjmeter-maven-plugin

Jmeter maven plugin | maven build not failing even if there are failures


I am using JMeter maven plugin 2.6.0 I have a JMeter test plans which contains some test.

I am running the jmx plans through maven build. Even if there are failures, maven build is not getting failed.

I want the maven build to be failed. I am using false in jmeter maven plugin configuration.

The configuration my pom.xml is this:

<plugin>
                    <groupId>com.lazerycode.jmeter</groupId>
                    <artifactId>jmeter-maven-plugin</artifactId>
                    <version>2.6.0</version>
                    <executions>
                        <execution>
                            <id>test</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jmeter</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <resultsFileFormat>jtl</resultsFileFormat>                       <resultsFileNameDateFormat>YYYY</resultsFileNameDateFormat>
                        <ignoreResultFailures>false</ignoreResultFailures>
                     </configuration>
                </plugin>

Solution

  • As per this doc:

    There is a bloc missing in your configuration:

    <execution>
       <id>jmeter-check-results</id>
       <goals>
              <goal>results</goal>
       </goals>
    </execution>