Skip to content

Instantly share code, notes, and snippets.

@djangofan
Last active March 15, 2017 21:49
Show Gist options
  • Save djangofan/9748661 to your computer and use it in GitHub Desktop.
Save djangofan/9748661 to your computer and use it in GitHub Desktop.
pom.xml file for JMeter project
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>JMeterTest</groupId>
<artifactId>JMeterTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>JMeterTest</name>
<description>JMeter tests for testing API</description>
<dependencies>
<dependency>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.9.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>test</phase>
<goals>
<goal>jmeter</goal>
</goals>
<configuration>
<resultsDirectory>${project.build.directory}/jmeter/results</resultsDirectory>
<ignoreResultFailures>true</ignoreResultFailures>
<suppressJMeterOutput>false</suppressJMeterOutput>
<skipTests>${skipTests}</skipTests>
<resultsFileFormat>xml</resultsFileFormat>
<testResultsTimestamp>false</testResultsTimestamp>
<appendResultsTimestamp>true</appendResultsTimestamp>
<propertiesSystem>
<url>${url}</url>
</propertiesSystem>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>transform</goal>
</goals>
</execution>
</executions>
<configuration>
<transformationSets>
<transformationSet>
<dir>${project.build.directory}/jmeter/results</dir>
<stylesheet>${project.basedir}/src/test/jmeter/jmeter-results-report_21.xsl</stylesheet>
<outputDir>${project.build.directory}/jmeter/results</outputDir>
<fileMappers>
<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper">
<pattern>(.*?)\s(.*?)</pattern>
<replacement>$1$2</replacement>
<replaceAll>true</replaceAll>
</fileMapper>
<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
<targetExtension>.html</targetExtension>
</fileMapper>
</fileMappers>
</transformationSet>
</transformationSets>
</configuration>
</plugin>
</plugins>
</build>
</project>
@Abel0916
Copy link

Hi,
I am doing API test using Jmeter, now i meet one issue on how to publish jmeter report to Jenkins.
I tries performance plugin in Jenkins, but it didn't meet what i want. I hope the report can provide some summary report, such cases number, how many cases are pass, and how many cases are failed.

Could you share your solution to me? I will appreciate it. Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment