'how to Use system properties to pass parameters to the runner/maven build

I want to run my test in three different preset resolution: 768x1024, 360x740, 1920x1024 using the existing framework. And I have to use system properties to pass parameters to the runner/maven build. I've tried systemPropertyVariable. It worked fine with one resolution size but I don't know how to pass all the three preset resolutions.

private static void setupBrowser(final WebDriver webDriver) {

    String width=System.getProperty("width");
    String heigth=System.getProperty("heigth");
    
    final Dimension targetResolution = new Dimension(Integer.parseInt(width),Integer.parseInt(heigth));

here my systemPropertyVariables:

<configuration>
    <systemPropertyVariables>
        <width>768</width>
        <heigth>1024</heigth>
    </systemPropertyVariables>
    <suiteXmlFiles>
        <suiteXmlFile>testng.xml</suiteXmlFile>
    </suiteXmlFiles>
</configuration>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source