【问题标题】:How to generate "HTML Reports" using latest version (3.1.1) of jmeter-maven-plugin如何使用最新版本(3.1.1)的 jmeter-maven-plugin 生成“HTML 报告”
【发布时间】:2020-11-03 22:17:52
【问题描述】:

当我使用 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> ```

【问题讨论】:

    标签: maven jmeter jmeter-maven-plugin


    【解决方案1】:

    这个configuration block

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

    必须&lt;execution&gt; 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>
    

    更多信息:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-23
      • 1970-01-01
      相关资源
      最近更新 更多