Below is the relevant part of my POM -
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.5.0</version>
<executions>
<execution>
<id>StartHub</id>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<arguments>
<argument>-jar</argument>
<argument>${basedir}/src/lib/Hub/selenium-server-standalone-2.53.0.jar</argument>
<argument>-role</argument>
<argument>hub</argument>
<argument>-throwOnCapabilityNotPresent</argument>
<argument>false</argument>
<argument>-newSessionWaitTimeout</argument>
<argument>20000</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>StartNode</id>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<arguments>
<argument>-jar</argument>
<argument>${basedir}/src/lib/Node/selenium-server-standalone-2.53.0.jar</argument>
<argument>-hub</argument>
<argument>http://127.0.0.1:4444/register/grid</argument>
<argument>-port</argument>
<argument>5555</argument>
<argument>
Dwebdriver.chrome.driver=${basedir}/chromedriver.exe</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
I was trying to use the exec plugin to execute a jar(selenium standalone server) in two configurations(hub and Node).
My issue is that the jar is executed only once in the configuration specified between the first pair of "execution" tags. I have searched extensively for a solution and the only thing I found was that the id's for different executions need to be different, which I rectified. I still can't seem to manage to run the jars twice even though I can run any one of them successfully if I comment out the execution of the other.
I should also mention that I'm running the project in Eclipse, so ideally what I would want to do is right-click on the POM.xml click on Run-as and select "Maven test".