Set JMeter properties using Maven plugin
Asked Answered
K

2

5

I am using the Maven plugin for JMeter (http://jmeter.lazerycode.com/).

In my JMeter test plan I have defined various properties e.g. hostName, threadCount etc.

If I were to use the standard JMeter program from the command line I would specify the properties like this:

jmeter -n -t mytest.jmx -JhostName=www.example.com -JthreadCount=5

As the Maven JMeter plugin is executed via the following command:

mvn verify

How do I pass the property values? The command:

mvn verify -JhostName=www.example.com -JthreadCount=5

Does not seem to work. I must be missing something obvious

Kapoor answered 12/10, 2012 at 12:28 Comment(0)
V
7

Outside of your <build> block. You can put:

  <properties>
    <my.host>localhost</my.host>
  </properties>

and then update your configuration block to say:

<propertiesUser> 
    <hostName>${my.host}</hostName> 
</propertiesUser> 

Finally, when executing maven, you can override with:

mvn verify "-Dmy.host=www.testsite.com"
Vertebral answered 7/5, 2013 at 23:25 Comment(0)
G
0
  <properties>
<my.host>hostname</my.host>

<propertiesUser> 
<hostName>${my.host}</hostName> 

Finally, when executing maven, you can override with:

mvn verify "-Dmy.host=www.testsite.com" should it not be like this?

Goodfellowship answered 12/8, 2014 at 11:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.