# How do I set a project property through the maven command line?

**URL:** <https://community.smartbear.com/t/how-do-i-set-a-project-property-through-the-maven-command-line/107>\
**Category:** ReadyAPI\
**Tags:** readyapi, api, migrated\
**Created:** [July 13, 2017, 2:51pm UTC](https://community.smartbear.com/t/how-do-i-set-a-project-property-through-the-maven-command-line/107 "2017-07-13T14:51:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [July 13, 2017, 2:51pm UTC](https://community.smartbear.com/t/how-do-i-set-a-project-property-through-the-maven-command-line/107/1 "2017-07-13T14:51:00Z")

</div>

> Originally posted by **kmaster** on July 13, 2017

I’m using the maven-soapui-extension-plugin and I’m trying to figure out a way to run all the tests in a project with a specific tag. I couldn’t find a way to do this with the built in tagging feature (at least not through maven) so I’ve created a project property that I want to be able to set through the maven command line so I can have all the other tests cross check against this property to determine whether they should execute or not.

I’ve setup the project property in the pom.xml like this:

 testExecution="Smoke\_Test" 

I also created a custom project property through the UI using the custom project properties and left the value blank so it could be replaced with this. However, even without adding a flag in the command line the pom.xml is not changing the property to Smoke\_Test for me. I figure I’ve done something wrong but I can’t seem to get it to work. I’m also not sure how to change the property through maven, from what I’ve read here on other posts the command has to use -Dsoapui.projectProperties. How do I actually use this? Is it just -Dsoapui.projectProperties.testExecution=“tag\_i\_want”?

Thanks.

K M

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [July 13, 2017, 5:49pm UTC](https://community.smartbear.com/t/how-do-i-set-a-project-property-through-the-maven-command-line/107/2 "2017-07-13T17:49:37Z")

</div>

> Originally posted by **kmaster** on July 13, 2017

I’ve made some progress. I’ve finally got the pom.xml file to pass in the parameter I wanted for the project property. I deleted the custom project property from the SoapUI and changed the xml to have this instead:

 testExecution=${projectProperty} 

I then defined the projectProperty later in the pom right before :

 Smoke\_Test 

Trying now to change the value of project property. I’ve tried -Dproperties.projectProperty=new\_val but no luck.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [July 13, 2017, 8:06pm UTC](https://community.smartbear.com/t/how-do-i-set-a-project-property-through-the-maven-command-line/107/3 "2017-07-13T20:06:56Z")

</div>

> Originally posted by **kmaster** on July 13, 2017

Alright figured it out. I changed the project property value (the one right before ) to $(projectProperty) and now I can use -DprojectProperty=“any\_val” to pass in whatever I want. Hope this helps someone later

Edit: I should note that in order to actually use the property in the test cases, I had used a groovy script and the get data to define it in a script. However, since I deleted it after it won’t show up anymore but you can still define the property like such:

def testExecution = context.expand( ‘${#Project#testExecution}’ ) // the property name is ‘testExecution’ in my case

I’m not sure whether or not it would work if I hadn’t deleted the custom property. It may not have made a difference.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [July 14, 2017, 7:52am UTC](https://community.smartbear.com/t/how-do-i-set-a-project-property-through-the-maven-command-line/107/4 "2017-07-14T07:52:38Z")

</div>

> Originally posted by **TanyaYatskovska** on July 14, 2017

Hi,

Thanks for sharing your solution with us. It will help other community members for sure!

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [October 7, 2026, 5:11pm UTC](https://community.smartbear.com/t/how-do-i-set-a-project-property-through-the-maven-command-line/107/5 "2026-10-07T17:11:48Z")

</div>

Closed on October 7, 2026, 5:11pm UTC

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
