cucumber jvm - maven project, some imports can't be resolved

3,620 views
Skip to first unread message

Hugo McConnell

unread,
Feb 19, 2014, 6:48:54 PM2/19/14
to cu...@googlegroups.com
hi,

I've been working with a cucumber-jvm maven project for a few weeks on windows 7.

Tonight, I setup eclipse and all the relevant plugins on an xp machine and imported the project into the workspace on that machine. All the maven dependancies exist now, but most of my import statements for cucumber are giving me errors saying they can't be resolved: eg:

import cucumber.api.CucumberOptions;

and 

import cucumber.api.DataTable;
import cucumber.api.PendingException;
import cucumber.api.Scenario;
import cucumber.api.java.After;
import cucumber.api.java.Before;


others like these work ok:

import cucumber.api.java.en.Given;
import cucumber.api.java.en.When;
import cucumber.api.java.en.Then;


I'll paste in the code from the pom. Given that these have been working ok for a few weeks in my other environment, and i can see the jar files all exists under  maven dependancies, I'm not quite sure where to go from here. I tried to set up a new project, and start from scratch but i'm getting the same issue. All other imports like selenium etc. work ok.

Pom contents are below:

  <modelVersion>4.0.0</modelVersion>

  <groupId>com.crc</groupId>
  <artifactId>cucumber</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>cucumber</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-java</artifactId>
    <version>1.1.5</version>
    </dependency>
    <dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-junit</artifactId>
    <version>1.1.5</version>
    </dependency>
    <dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-picocontainer</artifactId>
    <version>1.1.5</version>
    </dependency>
    <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>2.37.1</version>
    </dependency>
    <dependency>
    <groupId>net.masterthought</groupId>
    <artifactId>maven-cucumber-reporting</artifactId>
    <version>0.0.4</version>
    <type>maven-plugin</type>
    </dependency>
    <dependency>
    <groupId>net.masterthought</groupId>
    <artifactId>cucumber-reporting</artifactId>
    <version>0.0.21</version>
    </dependency>
      <dependency>
           <groupId>com.googlecode.totallylazy</groupId>
           <artifactId>totallylazy</artifactId>
           <version>991</version>
   </dependency>
  </dependencies>
   <repositories>
            <repository>
                <id>sonatype-releases</id>
            </repository>
            <repository>
            <id>repo.bodar.com</id>
            <url>http://repo.bodar.com</url>
      </repository>
   </repositories>
  <build>
  <plugins>
  <plugin>
  <groupId>de.saumya.mojo</groupId>
  <artifactId>cucumber-maven-plugin</artifactId>
  <version>1.0.0-rc4</version>
  </plugin>
  <plugin>
  <groupId>net.masterthought</groupId>
  <artifactId>maven-cucumber-reporting</artifactId>
  <version>0.0.4</version>
  </plugin>
  <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <testFailureIgnore>true</testFailureIgnore>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.masterthought</groupId>
                <artifactId>maven-cucumber-reporting</artifactId>
                <version>0.0.4</version>
                <executions>
                    <execution>
                        <id>execution</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <projectName>PageFactory</projectName>
                            <outputDirectory>${project.build.directory}/cucumber-html-reports</outputDirectory>
                            <cucumberOutput>${project.build.directory}/cucumber.json</cucumberOutput>
                            <enableFlashCharts>false</enableFlashCharts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
  </plugins>
  </build>
</project>
Reply all
Reply to author
Forward
0 new messages