I want to package a TestNG project to a Jar. I have got n number of testng xml files and only few xml are needed to be executed during the execution. The selection of the xml file to be run is done through maven pom.xml for example:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<!-- Suite testng xml file to consider for test execution -->
<suiteXmlFiles>
<suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
Here the actual xml name or path is not given but it is passed as an argument through maven command line. I wanted to know if I can achieve the same if I package the project to jar and if I can pass the xml file name to the jar execution command and I can execute that particular xml file. Is it possible? Hope anyone can help.
what i'm trying to achieve is something like this
java -jar -Dxml=integration.xml name.jar