2
votes

I'm sure other people tried this usage, but I could't find good examples online. I hope someone can help and comment whether it's doable at all.

Part of my pom.xml file is given below. The problem is that Maven couldn't find the "jmeter-ssh-sampler" declared as one dependency for "meter-maven-plugin". Should I configure Maven to search a different repositry for it ?

thanks Yulin

[ERROR] Failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:1.10.0:jmeter (jmeter-tests) on project jmeter-test: Execution jmeter-tests of goal com.lazerycode.jmeter:jmeter-maven-plugin:1.10.0:jmeter failed: Plugin com.lazerycode.jmeter:jmeter-maven-plugin:1.10.0 or one of its dependencies could not be resolved: Failure to find org.apache.jmeter.protocol.ssh.sampler:jmeter-ssh-sampler:jar:0.1.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]


<build>
    <plugins>
        <plugin>
            <groupId>com.lazerycode.jmeter</groupId>
            <artifactId>jmeter-maven-plugin</artifactId>
            <version>1.10.0</version>
            <executions>
                <execution>
                    <id>jmeter-tests</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>jmeter</goal>
                    </goals>
                    <configuration>
                        <suppressJMeterOutput>false</suppressJMeterOutput>                       
                        <propertiesUser> 
                            <host>${target_server}</host> 
                        </propertiesUser>
                        <jmeterPlugins>
                                    <plugin>
                                     <groupId>org.apache.jmeter.protocol.ssh.sampler</groupId>
                                            <artifactId>jmeter-ssh-sampler</artifactId>
                                    </plugin>
                        </jmeterPlugins>

                    </configuration>
                 </execution>
            </executions>

              <dependencies>
                                    <dependency>
                                            <groupId>com.jcraft</groupId>
                                            <artifactId>jsch</artifactId>
                                            <version>0.1.51</version>
                                    </dependency>
                                    <dependency>
                                              <groupId>org.apache.jmeter.protocol.ssh.sampler</groupId>
                                            <artifactId>jmeter-ssh-sampler</artifactId>
                                            <version>0.1.0</version>
                                    </dependency>
                </dependencies>
        </plugin>
    </plugins>
</build>

2

2 Answers

1
votes

jmeter-ssh-sampler is not available in maven central:

http://search.maven.org/#search|ga|1|org.apache.jmeter.protocol.ssh.sampler

If this dependency can't be located, I don't think jmeter-maven-plugin will be able to make use of jmeter-ssh-sampler. It either needs to be made available in the repository maven is looking for, or you may end up with dirty hacks, which I'd suggest to avoid as much as possible (e.g. manipulate file system directly).

1
votes

The JMeter SSH Sampler is not in any Maven repository. Most easy way to add it, clone the git repo, compile the code, and upload (deploy) the jar to your central Maven repository.