How to make maven run only JMeter tests (no other life cycles)

We are using maven-jmeter-plugin and I set up the jmeter profile. When I run mvn -Pjmeter verify , the various maven life cycles start, but none of them need it.

How can I run only 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> 
+4
source share
2 answers

Unfortunately, it seems that the author of the plugin did not implement MOJO, which would support a direct call, so the plugin should be used as part of the life cycle execution - in the <build> section.

If you need to run tests quickly, you can try temporarily changing the <phase> to an earlier one, such as validate . I am sure, however, this is not the phase in which the plugin should be launched, so you cannot change this forever.

+1
source

You can only run JMeter tests with the following command:

 mvn jmeter:jmeter -Pjmeter 

To see the rest of the goals, you can do the following:

 mvn help:describe -DgroupId=com.lazerycode.jmeter -DartifactId=jmeter-maven-plugin -Ddetail=true 
+1
source

Source: https://habr.com/ru/post/1492830/


All Articles