I am setting up my Maven project written in Java which has Cucumber framework and Runner class uses TestNG. I am getting environment details e.g. URL, user id etc from config.properties at the moment. I want to enhance my code which can take parameters from mvn command line to set environment variables in properties file and execute from there.
Would be great if someone can help me to update my pom.xml and java code to support the above feature.
I tried searching on the internet with the proper guidence and could not get the end to end modifications that are required
I am using maven-surefire_plugin at the moment with the following tags, could not get data properly to my runner file
<systemProperties>
<property>
<name>env</name>
<value>$(env)</value>
</property>
</systemProperties>
With the above tags, I am getting the 'env' value by System.getProperty(), but it seems it does not get all details