THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- Create a local Maven repository, if you don't already have one.
Wiki Markup Drop in the attached \[^jmeter-2.2.jar JMeter jar\] and \[^jmeter-2.2.pom POM\]. You do not need to have JMeter separately installed.
- Add the jar files that are referenced in the JMeter POM to your local repository, if they are not on ibiblio.
Wiki Markup Download the attached \[^maven-jmeter-plugin-src.tar.gz Maven JMeter Plugin source tarball\]. Untar it.
- Run "mvn install" to build and install the plugin.
- In your project's pom.xml, add a dependency on this plugin:
No Format <dependency> <groupId>org.apache.jmeter</groupId> <artifactId>maven-jmeter-plugin</artifactId> <version>1.0-SNAPSHOT</version> <type>plugin</type> </dependency>
- Create a src/test/jmeter directory, and place your JMeter load tests there.
- Create a jmeter.properties file in src/test/jmeter. It's fine to just copy the default properties file from the JMeter install if you want.
- Optionally configure includes and excludes in your pom.xml for which tests to run. If you don't, it will just run **/*.jmx. For example:
No Format <build> <plugins> <plugin> <groupId>org.apache.jmeter</groupId> <artifactId>maven-jmeter-plugin</artifactId> <configuration> <includes> <include>myTest1.jmx</include> <include>myTest2jmx<<include>myTest2.jmx</include> </includes> </configuration> </plugin> </plugins> </build>
- The default reports directory is 'jmeter-reports' which is created in the base folder ( usually where maven is run from )
- Changing the reports directory : Add a reportDir setting to the plugin configuration. for example:
No Format <build> <plugins> <plugin> <groupId>org.apache.jmeter</groupId> <artifactId>maven-jmeter-plugin</artifactId> <configuration> <includes> <include>myTest1.jmx</include> <include>myTest2.jmx</include> </includes> <reportDir>target/jmeter-reports</reportDir> </configuration> </plugin> </plugins> </build>
- Run "mvn org.apache.jmeter:maven-jmeter-plugin:jmeter" to run the tests.
– Tim McCuneKartikeya Rao