簡體   English   中英

如何使用最新版本 (3.1.1) 的 jmeter-maven-plugin 生成“HTML 報告”

[英]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>
   <generateReports>true</generateReports>
</configuration>

必須<execution>之外

完整的 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>

更多信息:

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM