I am having a new Maven project and I want to pass parameters through command line..
This is my requirement -
If I pass - install -Dinfra=local
then my test should run on local machine
If I pass - install -Dinfra=ip
then my test should run on the machine having desired ip.
I just wanted to know how to configure this infra
into my project so that I can access that through command line.. Many thanks!
You can define a property in your POM:
<project>
...
<properties>
<infra>local</infra>
</properties>
...
</project>
Then you can reference it in the POM by using ${infra}
. You can overwrite the value of the property through the command line (as in your example).
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments