Basic Configuration

Philippe M edited this page Nov 7, 2017 · 21 revisions

Basic Configuration

Add the plugin to the build section of your pom.xml (Best practice is to define the version of the Maven JMeter plugin that you want to use in either your pom.xml or a parent pom.xml):

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmeter</groupId>
                    <artifactId>jmeter-maven-plugin</artifactId>
                    <version>USE LAST VERSION</version>
                    <executions>
                        <execution>
                            <id>jmeter-tests</id>
                            <goals>
                                <goal>jmeter</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    [...]
</project>
+---+

By default the plugin uses the default properties files supplied with JMeter. If you want to override any of these files you simply need to create a replacement in ${project.base.directory}/src/test/jmeter.

The following properties files will be used if they are found in ${project.base.directory}/src/test/jmeter:

  • jmeter.properties
  • saveservice.properties
  • upgrade.properties
  • system.properties
  • user.properties
  • global.properties

The plugin will copy all of the all of the JMX test files held in the ${project.base.directory}/src/test/jmeter/ directory, and sub-directories, to ${project.build.directory}/jmeter/testFiles.

Any sub-directories will be flattened and the directory path will be used to create the test filename. Tests will then be run using all of the files in ${project.build.directory}/jmeter/testFiles.

For other configuration files like log4j2.xml, use folder ${project.base.directory}/src/test/conf.

To run the tests open a terminal/command prompt and then type:

cd ${project.base.directory}
mvn verify

There are a series of configuration options available, see the advanced configuration section.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.