0

Problem with Jmeter loading a keystore file while using jmeter-maven-plugin with the following options set:

<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>

And the error I get is:

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

I don't see how its possible that the file couldn't be found since the jMeterTestFile parameter obviously appears to work. What am I doing wrong?

djangofan
  • 28,471
  • 61
  • 196
  • 289

1 Answers1

2

Try this solution:

<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>
lucianojs
  • 165
  • 1
  • 8
  • The problem I get here is that the .jks file is not getting copied into target/jmeter folder before the run. So, it thinks its missing. Does jmeter-maven-plugin have a config for making sure the .jks is included in the build? – djangofan Jul 21 '20 at 23:58