3

I am planning to write the jmeter test in java and I understand that we can copy the jar files from jmeter installations into the build path of my java project. But to make things easier do we have the maven dependecy which can be easily loaded in POM to download all the necessary jmeter files in my java project.

pune06
  • 123
  • 2
  • 10
  • in maven repository you can find something about Jmeter. this is the [link](http://mvnrepository.com/artifact/org.apache.jmeter) – Hohenheim Apr 12 '16 at 10:13
  • 2
    Why don't you write your JMeter tests and then make use of [*jmeter-maven-plugin*](https://github.com/jmeter-maven-plugin/jmeter-maven-plugin) to run them? – António Ribeiro Apr 12 '16 at 10:43
  • @aribeiro - I have an existing java project that already have a tons of useful code that I need for my tests(mostly test data creation). So, if I have my project java code and jmeter test at one place, it would be easier. I know that, I can package my project Jars and put it in the jmeter installation directory, but I dont like the Beanshell editor inside jmeter and Also the error messages while debugging are not informative in the jmeter logs. – pune06 Apr 12 '16 at 11:07

2 Answers2

3

It is, i.e. you can plug Apache JMeter Core like:

<dependency>
    <groupId>org.apache.jmeter</groupId>
    <artifactId>ApacheJMeter_core</artifactId>
    <version>2.13</version>
</dependency>

See

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
2

You're right. Using Maven with its dependency mechanism is far better than to "copy the jar files from [...] installations into the build path of my java project" in general.

JMeter is available in Maven's Central Repository.

See also the jmeter-maven-plugin mentioned in aribeiro's comment.

Community
  • 1
  • 1
Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
  • Thanks @Gerold and @ Hohenheim for the dependencies. But I get an error in the POM on adding the dependencies. Below is the error:- Multiple annotations found at this line: - Missing artifact commons-pool2:commons-pool2:jar:2.3 - Missing artifact commons-math3:commons-math3:jar: – pune06 Apr 12 '16 at 11:57
  • No worries. I resolved this error. For some reason my Maven was messed up. Thanks Anyways!!! – pune06 Apr 12 '16 at 12:43
  • np bro @pune06 happy for you – Hohenheim Apr 12 '16 at 13:20