Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have maven run just JMeter tests (no other life cycles)

We're using the maven-jmeter-plugin and I've setup a jmeter profile. When I run mvn -Pjmeter verify the various maven life cycles get run, but none of them need to.

How can I run just the JMeter tests?

<profile>
  <id>jmeter</id>
  <build>
    <plugins>
      <plugin>
        <groupId>com.lazerycode.jmeter</groupId>
        <artifactId>jmeter-maven-plugin</artifactId>
        <version>${jmeter.version}</version>
        <executions>
          <execution>
            <id>jmeter-tests</id>
            <phase>verify</phase>
            <goals>
              <goal>jmeter</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <testResultsTimestamp>false</testResultsTimestamp>
        </configuration>
      </plugin>
    </plugins>
  </build>
</profile>
like image 671
EGHM Avatar asked Jul 23 '13 00:07

EGHM


2 Answers

Unfortunately, it looks like the author of the plugin did not implement a MOJO that would support direct invocation, hence the plugin must be used as a part of lifecycle execution — within the <build> section.

If you need to run tests quickly, you could try to temporarily change the <phase> to some earlier one, for example validate. I'm sure, though, this is not the phase the plugin intended to be run in, so you can't change this permanently.

like image 131
MaDa Avatar answered Oct 14 '22 01:10

MaDa


You can run just JMeter tests with the following command:

mvn jmeter:jmeter -Pjmeter

To see the rest of the goals you can execute the following:

mvn help:describe -DgroupId=com.lazerycode.jmeter  -DartifactId=jmeter-maven-plugin -Ddetail=true
like image 25
Ruslans Uralovs Avatar answered Oct 14 '22 01:10

Ruslans Uralovs