Forum Discussion

nukul's avatar
nukul
Occasional Visitor
5 years ago

deprecated Main class error while using Cucumber 6.1.1

Hello Team

 

I have installed Cucumber plugin in latest eclipse version and Cucumber which gets installed as plugin is 6.1.1

I have added all the necessary dependencies from the Github location :https://github.com/cucumber/cucumber-java-skeleton/blob/master/pom.xml

 

Now when I am trying to run my feature file which contains a scenario ,I am getting the warning as

Jun 23, 2020 7:03:00 PM cucumber.api.cli.Main run
WARNING: You are using deprecated Main class. Please use io.cucumber.core.cli.Main

 

And as a result of this somehow execution is failing ans my output is:

Jun 23, 2020 7:03:00 PM cucumber.api.cli.Main run
WARNING: You are using deprecated Main class. Please use io.cucumber.core.cli.Main

Scenario: Add a menu item # src/test/java/linkedlearning/cucumbercourse/features/MenuManagement.feature:3

0 Scenarios
0 Steps
0m1.020s

 

Now in the cucumber-core-6.1.1.jar,I can see that it has 

--cucumber.api.cli package which has Main class and I suppose the execuion is referring to this instead of

--io.cucumber.core.cli package which has Main class 

 

Can you please help.

 

Thanks

 

 

 

  • You can safely ignore this warning. All it means is that cucumber-eclipse has not yet been updated to use Cucumber's new package structure. We have an open issue about this. If you feel strongly about it you can help us by submitting a pull request to cucumber-eclipse.

  • aslakhellesoy's avatar
    aslakhellesoy
    SmartBear Alumni (Retired)

    You can safely ignore this warning. All it means is that cucumber-eclipse has not yet been updated to use Cucumber's new package structure. We have an open issue about this. If you feel strongly about it you can help us by submitting a pull request to cucumber-eclipse.

    • ankeetah's avatar
      ankeetah
      New Contributor

      Hey Nukul,

       

      I read that you found the solution, I did too, I tried getting the feature file package properly, named like "package.feature" and also check if the dependency version does match in pom.xml. 

      Keep exploring, thank you.

       

      Thanks, 

      Ankita G.

  • ankeetah's avatar
    ankeetah
    New Contributor

    Hi , 

     

    did you found any solution to this?

     I am getting same error. 

    • cbliard's avatar
      cbliard
      SmartBear Alumni (Retired)

      Thanks for your feedback!

      I'm installing Eclipse so I can try reproducing it locally and eventually fix it or give a workaround. I'll keep you informed.

  • cbliard's avatar
    cbliard
    SmartBear Alumni (Retired)

    I'm failing to reproduce your issue. I'll need more details about your setup.

     

    Here are the steps I performed:

    - download and install Eclipse 2020-06

    - clone the cucumber-java-skeleton project on my machine

    - select File > Import > Existing Maven Projects to import the cucumber-java-skeleton as an Eclipse project

    - Install the Cucumber plugin from the marketplace

     

    When running maven test (right click the pom.xml in package explorer, select Run As > maven test), then the feature is run as expected

     

    When openining the RunCucumberTest.java file and running it as JUnit test (right click in the file, Run As > Junit test), then it works too.

     

    Can you describe me the steps to perform so I can reproduce your issue?