0

使用带有以下选项集的 jmeter-maven-plugin 时 Jmeter 加载密钥库文件的问题:

<plugin>
    <groupId>com.lazerycode.jmeter</groupId>
    <artifactId>jmeter-maven-plugin</artifactId>
    <version>${jmeter.maven.plugin.version}</version>
    <executions>
        <!-- defines a runner for jmeter tests project -->
        <execution>
            <id>jmeter-tests</id>
            <phase>test</phase>
            <goals>
                <goal>jmeter</goal>
            </goals>
            <configuration>
                <resultsDirectory>${project.build.directory}/jmeter/results</resultsDirectory>
                <ignoreResultFailures>true</ignoreResultFailures>
                <suppressJMeterOutput>false</suppressJMeterOutput>
                <resultsFileFormat>xml</resultsFileFormat>
                <testResultsTimestamp>false</testResultsTimestamp>
                <appendResultsTimestamp>false</appendResultsTimestamp>
                <testFilesIncluded>
                    <jMeterTestFile>Service-Tests.jmx</jMeterTestFile>
                </testFilesIncluded>
                <propertiesSystem>
                    <javax.net.ssl.keyStore>jmeterTrustedKeystore.jks</javax.net.ssl.keyStore>
                    <javax.net.ssl.keyStorePassword>changeit</javax.net.ssl.keyStorePassword>
                </propertiesSystem>
            </configuration>
        </execution>
    </executions>
</plugin>

我得到的错误是:

2015/01/22 10:48:38 INFO  - jmeter.util.SSLManager: JmeterKeyStore Location:  type JKS 
2015/01/22 10:48:38 INFO  - jmeter.util.SSLManager: KeyStore created OK 
2015/01/22 10:48:38 WARN  - jmeter.util.SSLManager: Keystore file not found, loading empty keystore

我不明白为什么找不到该文件,因为 jMeterTestFile 参数显然似乎有效。我究竟做错了什么?

4

1 回答 1

2

试试这个解决方案:

<plugin>
    <groupId>com.lazerycode.jmeter</groupId>
    <artifactId>jmeter-maven-plugin</artifactId>
    <version>${jmeter.maven.plugin.version}</version>
    <executions>
        <!-- defines a runner for jmeter tests project -->
        <execution>
            <id>jmeter-tests</id>
            <phase>test</phase>
            <goals>
                <goal>jmeter</goal>
            </goals>
            <configuration>
                <resultsDirectory>${project.build.directory}/jmeter/results</resultsDirectory>
                <ignoreResultFailures>true</ignoreResultFailures>
                <suppressJMeterOutput>false</suppressJMeterOutput>
                <resultsFileFormat>xml</resultsFileFormat>
                <testResultsTimestamp>false</testResultsTimestamp>
                <appendResultsTimestamp>false</appendResultsTimestamp>
                <testFilesIncluded>
                    <jMeterTestFile>Service-Tests.jmx</jMeterTestFile>
                </testFilesIncluded>
                <jMeterProcessJVMSettings>
                    <arguments>
                        <argument>-Djavax.net.ssl.keyStore=jmeterTrustedKeystore.jks</argument>
                        <argument>-Djavax.net.ssl.keyStorePassword=changeit</argument>
                    </arguments>
                </jMeterProcessJVMSettings>
            </configuration>
        </execution>
    </executions>
</plugin>
于 2016-11-03T21:40:37.023 回答