首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >JMeter maven插件-自定义reportgenerator.properties

JMeter maven插件-自定义reportgenerator.properties
EN

Stack Overflow用户
提问于 2021-12-14 18:56:30
回答 2查看 152关注 0票数 2

当我使用JMeter Maven插件并运行mvn jmeter:configure时,它会自动创建一个默认的bin/reportgenerator.properties文件。

如何自定义此文件?是否有一种方法可以在Is maven插件配置中指定一些属性,以便我可以设置,例如,report_title

请参阅:https://jmeter.apache.org/usermanual/generating-dashboard.html

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-12-15 07:00:55

参见改性性能 JMeter Maven插件维基一章。

您需要将以下块添加到<plugin>部分:

代码语言:javascript
运行
复制
<configuration>
    <propertiesUser>
        <jmeter.reportgenerator.report_title>your-custom-title</jmeter.reportgenerator.report_title>
    </propertiesUser>
</configuration>

完全pom.xml,以防万一:

代码语言:javascript
运行
复制
<?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-maven</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>com.lazerycode.jmeter</groupId>
                <artifactId>jmeter-maven-plugin</artifactId>
                <version>3.4.0</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>
                    <propertiesUser>
                        <jmeter.reportgenerator.report_title>your-custom-title</jmeter.reportgenerator.report_title>
                    </propertiesUser>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

更多信息:How to Use the JMeter Maven Plugin

票数 3
EN

Stack Overflow用户

发布于 2021-12-14 20:41:05

添加到pom.xml

Shantonu示例

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70354230

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档