cucumber / cucumber-jvm

Cucumber for the JVM
https://cucumber.io
MIT License
2.7k stars 2.02k forks source link

upgrade java 17 #2566

Closed BeatrizLo closed 2 years ago

BeatrizLo commented 2 years ago

Hello! I'm using version 17 of java to run my tests, and the error I'm getting is this:

java.lang.ExceptionInInitializerError
at cucumber.deps.com.thoughtworks.xstream.XStream.setupConverters(XStream.java:820)

Is this going to be fixed at some point? Because the tests only work for me when I use java 1.8, and I need to use my own library that uses java 17, can someone help me? I have also tried adding this in the pom:

<dependency>
                 <groupId>io.cucumber</groupId>
                 <artifactId>cucumber-jvm</artifactId>
                 <version>7.3.4</version>
                 <type>pom</type>
             <exclusions>
                 <exclusion>
                     <groupId>io.cucumber</groupId>
                     <artifactId>cucumber-jvm-deps</artifactId>
                 </exclusion>
             </exclusions>
 </dependency>

But it still doesn't work, can someone help me?

mpkorstanje commented 2 years ago

This was fixed in v3, it would appear that you are in the unenviable position of having to catch up with atleast 4 years worth of upgrades.

You can find the significant changes and hints to upgrade in the changelog and release notes:

And based on the snippet you posted I would strongly urge you to invest time in learning how to use Maven (or Gradle) beyond a superficial level. Understanding these tools and the concepts involved can make your life much easier.