How to pass multiple suiteXML files from command l

2019-06-08 16:31发布

问题:

I am required to run multiple XML suite files from command line.

My POM.xml -

<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.5</version>
    <configuration>
        <suiteXmlFiles>
                <suiteXmlFile>src/test/resources/xml_Suites/${tests}.xml</suiteXmlFile>
        </suiteXmlFiles>
        <testFailureIgnore>true</testFailureIgnore>
    </configuration>
</plugin>

Trying this from command line -

mvn clean -Dtests={abcd,xyz} test

Only xyz.xml is being triggered while abcd.xml is not being triggered.

Basically only the last xml file mentioned in the braces is being triggered.

Is there anything wrong in the above syntax?

回答1:

I think you need to specify using enitre path Change -Dtests=src/test/resources/xml_Suites/abcd.xml,src/test/resources/xml_Suites/xyz.xml