如何使用最新版本 (3.1.1) 的 jmeter-maven-plugin 生成 "HTML Reports"

How to generate "HTML Reports" using latest version (3.1.1) of jmeter-maven-plugin

当我使用 2.8.0 版本的 jmeter-maven-plugin 时,我能够生成 HTML 报告。我清楚地看到一个文件夹target\jmeter\reports。但是,当我使用 3.1.1(最新)版本时,我根本看不到这个文件夹。

如果有什么方法可以用最新版本生成 HTML 报告,请告诉我。

下面是我的 pom.xml 示例:

       <plugins>
           <plugin>
               <groupId>com.lazerycode.jmeter</groupId>
               <artifactId>jmeter-maven-plugin</artifactId>
               <version>2.8.0</version>
               <executions>
                   <!-- Run JMeter tests -->
                   <execution>
                       <id>jmeter-tests</id>
                       <goals>
                           <goal>jmeter</goal>
                       </goals>
                   </execution>
                   <execution>
                       <id>configuration</id>
                       <goals>
                           <goal>configure</goal>
                       </goals>
                   </execution>
                   <!-- Fail build on errors in test -->
                   <execution>
                       <id>jmeter-check-results</id>
                       <goals>
                           <goal>results</goal>
                       </goals>
                       <configuration>
                           <generateReports>true</generateReports>
                       </configuration>
                   </execution>
               </executions>
           </plugin>
       </plugins>
   </build> ```

这个configuration block:

<configuration>
   <generateReports>true</generateReports>
</configuration>

必须在<execution> block

之外

完整 pom.xml 以防万一:

<?xml version="1.0" encoding="UTF-8"?>
<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>org.example</groupId>
    <artifactId>jmeter</artifactId>
    <version>1.0-SNAPSHOT</version>

    <build>
        <plugins>
            <plugin>
                <groupId>com.lazerycode.jmeter</groupId>
                <artifactId>jmeter-maven-plugin</artifactId>
                <version>3.1.1</version>
                <executions>
                    <!-- Generate JMeter configuration -->
                    <execution>
                        <id>configuration</id>
                        <goals>
                            <goal>configure</goal>
                        </goals>
                    </execution>
                    <!-- Run JMeter tests -->
                    <execution>
                        <id>jmeter-tests</id>
                        <goals>
                            <goal>jmeter</goal>
                        </goals>
                    </execution>
                    <!-- Fail build on errors in test -->
                    <execution>
                        <id>jmeter-check-results</id>
                        <goals>
                            <goal>results</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <generateReports>true</generateReports>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

更多信息: