2

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>

Yulin Qi
  • 21
  • 2

2 Answers2

1

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

automatictester
  • 2,436
  • 1
  • 19
  • 34
  • Probably also worth pointing out that this is a transitive dependency issue with JMeter. The JMeter team forgot to upload the SSH libraries to maven but are referencing them in their code. This is a bug with JMeter, not with the jmeter-maven-plugin. – Ardesco Oct 05 '15 at 10:45
  • @Ardesco No it is not forgotten by JMeter, as it is an not part of the official JMeter set of Plug-ins. It is a separate project now found on https://github.com/yciabaud/jmeter-ssh-sampler – Verhagen Oct 12 '15 at 19:11
  • GAH! Why is he using org.apache.meter.protocol.ssh.sampler as the then? I wish people would name their code appropriately. As it stands it's never going to hit maven central unless the JMeter dev team merge it into JMeter, release it for him or he changes the – Ardesco Oct 13 '15 at 21:34
1

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.

Verhagen
  • 3,885
  • 26
  • 36