I am getting Cucumber-JVM's --format option is deprecated. error

4,257 views
Skip to first unread message

A R K Satyanarayana Raju

unread,
Dec 13, 2014, 6:29:31 AM12/13/14
to cu...@googlegroups.com
Hi,

I am very new to cucumber. When i am trying to execute my feature file i am getting error like,

WARNING: Cucumber-JVM's --format option is deprecated. Please use --plugin instead.
Feature: Proof of concept that my framework worksException in thread "main" java.lang.NoSuchMethodError: gherkin.formatter.model.Scenario.getId()Ljava/lang/String;
at cucumber.runtime.ScenarioImpl.<init>(ScenarioImpl.java:28)
at cucumber.runtime.Runtime.buildBackendWorlds(Runtime.java:144)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:38)
at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:163)
at cucumber.runtime.Runtime.run(Runtime.java:120)
at cucumber.api.cli.Main.run(Main.java:36)
at cucumber.api.cli.Main.main(Main.java:18)

My feature file is:
Feature: Proof of concept that my framework works

  Scenario: My first test
    Given this is my first step
    When this is my second step
    Then this is my final step

I am using JDK1.8.

Can any one help me...

Thanks,
Raju

Aslak Hellesøy

unread,
Dec 13, 2014, 7:05:34 AM12/13/14
to cu...@googlegroups.com

On Saturday, 13 December 2014 at 11:29, A R K Satyanarayana Raju wrote:

Hi,

I am very new to cucumber. When i am trying to execute my feature file i am getting error like,

Warnings are not errors. You are getting both a warning and an error, and they are unrelated.

The warning should be self-explanatory. Use --plugin instead of --format. 
WARNING: Cucumber-JVM's --format option is deprecated. Please use --plugin instead.
Feature: Proof of concept that my framework worksException in thread "main" java.lang.NoSuchMethodError:
This error means you have incompatible har versions on your classpath.

Make sure your cucumber-* jar versions are all 1.2.0 and your gherkin version is 2.12.2.

Hope this helps
Aslak
gherkin.formatter.model.Scenario.getId()Ljava/lang/String;
at cucumber.runtime.ScenarioImpl.<init>(ScenarioImpl.java:28)
at cucumber.runtime.Runtime.buildBackendWorlds(Runtime.java:144)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:38)
at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:163)
at cucumber.runtime.Runtime.run(Runtime.java:120)
at cucumber.api.cli.Main.run(Main.java:36)
at cucumber.api.cli.Main.main(Main.java:18)

My feature file is:
Feature: Proof of concept that my framework works

  Scenario: My first test
    Given this is my first step
    When this is my second step
    Then this is my final step

I am using JDK1.8.

Can any one help me...

Thanks,
Raju

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rajwinder Kaur

unread,
Jan 5, 2015, 4:55:13 PM1/5/15
to cu...@googlegroups.com
Aslak-

When you said "The warning should be self-explanatory. Use --plugin instead of --format. "

How can we use Plugin( Where to install)? Even Today is my first day of learning cucumber, so Dont know exactly- Where to install plugin?

aslak hellesoy

unread,
Jan 5, 2015, 6:13:35 PM1/5/15
to Cucumber Users
On Mon, Jan 5, 2015 at 9:55 PM, Rajwinder Kaur <rdu...@gmail.com> wrote:
Aslak-

When you said "The warning should be self-explanatory. Use --plugin instead of --format. "

How can we use Plugin( Where to install)? Even Today is my first day of learning cucumber, so Dont know exactly- Where to install plugin?


There is nothing to install - all plugins are bundled with Cucumber. In your script that launches Cucumber you currently have "--format" somewhere. Replace that with "--plugin".

Aslak
 
On Saturday, December 13, 2014 6:29:31 AM UTC-5, A R K Satyanarayana Raju wrote:
Hi,

I am very new to cucumber. When i am trying to execute my feature file i am getting error like,

WARNING: Cucumber-JVM's --format option is deprecated. Please use --plugin instead.
Feature: Proof of concept that my framework worksException in thread "main" java.lang.NoSuchMethodError: gherkin.formatter.model.Scenario.getId()Ljava/lang/String;
at cucumber.runtime.ScenarioImpl.<init>(ScenarioImpl.java:28)
at cucumber.runtime.Runtime.buildBackendWorlds(Runtime.java:144)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:38)
at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:163)
at cucumber.runtime.Runtime.run(Runtime.java:120)
at cucumber.api.cli.Main.run(Main.java:36)
at cucumber.api.cli.Main.main(Main.java:18)

My feature file is:
Feature: Proof of concept that my framework works

  Scenario: My first test
    Given this is my first step
    When this is my second step
    Then this is my final step

I am using JDK1.8.

Can any one help me...

Thanks,
Raju

Surbhi A

unread,
Mar 7, 2015, 6:31:26 PM3/7/15
to cu...@googlegroups.com
Hi Aslak,

My situation is somewhat similar to Raju's. however, in my case there is only the following error:

java.lang.NoSuchMethodError: gherkin.formatter.model.Scenario.getId()Ljava/lang/String 
 at cucumber.runtime.ScenarioImpl.<init>(ScenarioImpl.java:28)
 at cucumber.runtime.Runtime.buildBackendWorlds(Runtime.java:144)
 at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:38)

I tried to search on the above, got some answer saying that we need to have 'Cucumber-JVM' dependency installed. I tried that thru maven, but I always get an error stating the 'Cucumber-JVM' jar could not be located.

My pom.xml looks like:

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.czeczotka.bdd</groupId>
    <artifactId>cucumber-jvm-maven</artifactId>

    <version>1.0-SNAPSHOT</version>
    <name>cucumber-jvm-maven</name>
    <url>http://maven.apache.org</url>

    <dependencies>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>1.2.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>1.2.0</version>
            <scope>test</scope>
        </dependency>
<dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-jvm-deps</artifactId>
            <scope>test</scope>
            <version>1.0.3</version>
        </dependency>
       <dependency>
<groupId>info.cukes</groupId>
<artifactId>gherkin</artifactId>
<version>2.12.1</version>
</dependency>


        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                
            </plugin>
        </plugins>
    </build>

</project>


and the feature file I am trying o execute is:
Feature: Calculator
  As a user
  I want to use a calculator
  So that I don't need to calculate myself

  Scenario: Add two numbers
    Given I have a calculator
    When I add 2 and 3
    Then the result should be 5


During execution the output is:

Running com.czeczotka.bdd.runner.RunCalculatorTest
Feature: Calculator
  As a user
  I want to use a calculator
  So that I don't need to calculate myself

0 Scenarios
0 Steps
0m0.000s

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.804 sec <<< FA
ILURE!
Feature: Calculator  Time elapsed: 0.08 sec  <<< ERROR!
java.lang.NoSuchMethodError: gherkin.formatter.model.Scenario.getId()Ljava/lang/
String;
        at cucumber.runtime.ScenarioImpl.<init>(ScenarioImpl.java:28)


Kindly help me to solve this.

Thanks,
Surbhi

aslak hellesoy

unread,
Mar 7, 2015, 6:34:36 PM3/7/15
to Cucumber Users
On Fri, Mar 6, 2015 at 9:00 PM, Surbhi A <sehgal....@gmail.com> wrote:
Hi Aslak,

My situation is somewhat similar to Raju's.

No, it's completely different.
 
however, in my case there is only the following error:

java.lang.NoSuchMethodError: gherkin.formatter.model.Scenario.getId()Ljava/lang/String 

You have an incompatible gherkin on your classpath. Remove it from your pom and all should be fine. You'll get the gherking that cucumber-java depends transitively on.
 

--

aslak hellesoy

unread,
Mar 7, 2015, 7:12:15 PM3/7/15
to Cucumber Users
On Sat, Mar 7, 2015 at 11:34 PM, aslak hellesoy <aslak.h...@gmail.com> wrote:


On Fri, Mar 6, 2015 at 9:00 PM, Surbhi A <sehgal....@gmail.com> wrote:
Hi Aslak,

My situation is somewhat similar to Raju's.

No, it's completely different.

Sorry, my bad. Your error is the same as Raju's. Just remove gherkin from your pom. You should never include it. 
Reply all
Reply to author
Forward
0 new messages