使用Jmeter Maven插件编辑jmeter saveservice.properties文件

时间:2012-12-20 21:19:36

标签: maven maven-3 jmeter jmeter-plugins jmeter-maven-plugin

当我使用Jmeter Maven插件调用Jmeter时,有没有办法编辑(添加一些属性)Jmeter saveservice.properties文件?

1 个答案:

答案 0 :(得分:0)

您可以将自己的saveservice.properties版本复制到:

${project.base.directory}/src/test/jmeter 

或者您可以使用< propertiesSaveService>覆盖特定属性配置设置如下:

+---+
<project>
    [...]
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>${project.artifactId}</artifactId>
                    <version>${project.version}</version>
                    <executions>
                        <execution>
                            <id>jmeter-tests</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jmeter</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <propertiesSaveService>
                            <HTTPSampler2>org.apache.jmeter.protocol.http.sampler.HTTPSampler2</HTTPSampler2>
                        </propertiesSaveService>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    [...]
</project>
+---+

此信息现在可在https://github.com/Ronnie76er/jmeter-maven-plugin/wiki/Modifying-Properties

的项目维基上获得