1

一年后,我们收回了我们的测试自动化,没有使用它。

今天,我尝试像往常一样运行它们(或者至少我记得)

mvn clean verify "-Dcucumber.options=--tags '@xxscenario'" -Dmaven.test.failure.ignore=true -P scenarioInitiator,dev,xxProject,postIC,preIC

这可能与今天我安装了 jdk 17 但我无法运行它们有关:

cucumber.runtime.CucumberException: Failed to instantiate public cucumber.runtime.java.JavaBackend(cucumber.runtime.io.ResourceLoader,io.cucumber.stepexpression.TypeRegistry) with [cucumber.runtime.io.MultiLoader@515ebef3, io.cucumb
er.stepexpression.TypeRegistry@545607f2]
Caused by: java.lang.reflect.InvocationTargetException
Caused by: java.util.ServiceConfigurationError: io.cucumber.core.backend.ObjectFactory: Provider cucumber.runtime.java.guice.impl.GuiceFactory could not be instantiated
Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.ExceptionInInitializerError
Caused by: java.lang.ExceptionInInitializerError
Caused by: com.google.inject.internal.cglib.core.$CodeGenerationException: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,
int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @7225790e
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatE
rror accessible: module java.base does not "opens java.lang" to unnamed module @7225790e

我已经阅读了一些关于此的主题,但我不确定要设置的工作区。

非常感谢。

编辑:将我的 JDK 回滚到 11,我不再有这个错误。我们能否进行更新以使其可以使用 java 17 JDK 运行?提前致谢 !

4

0 回答 0