Skip to content

Causes maven antrun to run more than once #30

@mse-rspenceley

Description

@mse-rspenceley

Hi

I'm using Maven to not only download the WebDrivers, but also to launch Selenium. My POM file contains the following:

<build>
        <plugins>
            <plugin>
                <groupId>com.lazerycode.selenium</groupId>
                <artifactId>driver-binary-downloader-maven-plugin</artifactId>
                <version>1.0.7</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>selenium</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-antrun-plugin</artifactId>
             <version>1.7</version>
                <executions>
                    <execution>
                        <id>hub</id>
                        <phase>test-compile</phase>
                        <configuration>
                            <target>
                                <echo message="Launching Selenium Hub"/>
                                <java classname="org.openqa.grid.selenium.GridLauncher"
                                  classpathref="maven.test.classpath"
                                  failonerror="true"
                                  fork="false">
                                    <arg line="-role hub"/>
                                </java>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>node</id>
                        <phase>test-compile</phase>
                        <configuration>
                            <target>
                                <echo message="Launching Selenium Node"/>
                                <java classname="org.openqa.grid.selenium.GridLauncher"
                                  classpathref="maven.test.classpath"
                                  failonerror="true"
                                  fork="false">
                                    <arg line="-role node -nodeConfig selenium/${seleniumNodeConfig}"/>
                                </java>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

When I run mvn test, it fires up the Selenium Hub and Node, then downloads the binaries, then tries to fire up Selenium again, obviously failing because its already running (I don't want to turn off failonerror for that). Doesn't seem to matter how I change phases, this always happens. Any idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions