Selenium code not compiling with Jenkins, but works with Maven

时间:2016-10-20 19:29:10

标签: maven jenkins selenium-webdriver

It might sound weird but my situation is that my code is not able to compile when I run it via Jenkins. Though it runs perfectly fine using command line with Maven.

Error is

package org.openqa.selenium.firefox does not exist

POM:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
        <fork>true</fork>
        <source>1.7</source>
        <target>1.7</target>
    </configuration>
</plugin>

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>2.53.1</version>
</dependency>

I am not able to figure out what's happening to resolve this.

1 个答案:

答案 0 :(得分:0)

Maybe you forgot this dependency:

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-firefox-driver</artifactId>
    <version>2.53.1</version>
</dependency>

Maven repository: https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-firefox-driver/2.0rc3

相关问题