java - 测试cucumber时出现错误NoSuchMethodError

标签 java maven cucumber hk2

我正在构建一个小 Maven 应用程序,但我在 cucumber 测试方面遇到问题。这是出现的错误:

java.lang.NoSuchMethodError: org.glassfish.hk2.utilities.general.GeneralUtilities.getSystemProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    at org.jvnet.hk2.internal.ServiceLocatorImpl.<clinit>(ServiceLocatorImpl.java:122)
    at org.jvnet.hk2.external.generator.ServiceLocatorGeneratorImpl.initialize(ServiceLocatorGeneratorImpl.java:66)
    at org.jvnet.hk2.external.generator.ServiceLocatorGeneratorImpl.create(ServiceLocatorGeneratorImpl.java:96)
    at org.glassfish.hk2.internal.ServiceLocatorFactoryImpl.internalCreate(ServiceLocatorFactoryImpl.java:312)
    at org.glassfish.hk2.internal.ServiceLocatorFactoryImpl.create(ServiceLocatorFactoryImpl.java:293)
    at org.glassfish.hk2.internal.ServiceLocatorFactoryImpl.create(ServiceLocatorFactoryImpl.java:157)
    at org.glassfish.hk2.utilities.ServiceLocatorUtilities.bind(ServiceLocatorUtilities.java:205)
    at org.glassfish.hk2.utilities.ServiceLocatorUtilities.bind(ServiceLocatorUtilities.java:220)
    at cucumber.runtime.java.hk2.impl.HK2Factory.start(HK2Factory.java:40)
    at cucumber.runtime.java.JavaBackend.buildWorld(JavaBackend.java:125)
    at cucumber.runtime.Runtime.buildBackendWorlds(Runtime.java:139)
    at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:38)
    at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91)
    at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
    at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
    at cucumber.api.junit.Cucumber.runChild(Cucumber.java:93)
    at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at cucumber.api.junit.Cucumber.run(Cucumber.java:98)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

我很确定我的依赖项有问题,但我似乎找不到问题,这是运行 mvn dependency:tree 的结果

[INFO] com.sac.ergo.riskbusinessadmissions:risk-business-admissions:jar:1.0.0
[INFO] +- com.sac.jee.arq.spring.core:arq-spring-servicing-core:jar:5.4.4.4:compile
[INFO] |  +- com.sac.jee.arq.spring.core:arq-spring-servicing-logging:jar:5.4.4.3:compile
[INFO] |  |  +- com.sac.semaas:delta:jar:0.7.0:compile
[INFO] |  |  |  +- com.squareup.okhttp:okhttp:jar:2.5.0:compile
[INFO] |  |  |  |  \- com.squareup.okio:okio:jar:1.6.0:compile
[INFO] |  |  |  \- com.google.code.gson:gson:jar:2.7:compile
[INFO] |  |  +- log4j:log4j:jar:1.2.17:compile
[INFO] |  |  +- org.apache.cxf:cxf-core:jar:3.2.4:compile
[INFO] |  |  |  +- com.fasterxml.woodstox:woodstox-core:jar:5.0.3:compile
[INFO] |  |  |  |  \- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
[INFO] |  |  |  \- org.apache.ws.xmlschema:xmlschema-core:jar:2.2.3:compile
[INFO] |  |  +- org.mongodb:mongodb-driver:jar:3.4.0:compile
[INFO] |  |  |  +- org.mongodb:mongodb-driver-core:jar:3.4.0:compile
[INFO] |  |  |  \- org.mongodb:bson:jar:3.4.0:compile
[INFO] |  |  \- org.springframework:spring-web:jar:5.0.4.RELEASE:compile
[INFO] |  +- com.sac.jee.arq.spring.core:arq-spring-monitoring:jar:5.4.0.0:compile
[INFO] |  |  +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO] |  |  +- javax.jms:jms:jar:1.1:compile
[INFO] |  |  +- org.apache.geronimo.specs:geronimo-commonj_1.1_spec:jar:1.0:compile
[INFO] |  |  +- javax.resource:connector-api:jar:1.5:compile
[INFO] |  |  \- com.rabbitmq:amqp-client:jar:3.3.5:compile
[INFO] |  +- com.sac.jee.arq.spring.core:arq-spring-servicing-fraud:jar:5.3.1.0:compile
[INFO] |  |  \- com.sac.jee.arq.spring.integraciones:securitydummy:jar:5.4.2.0:compile
[INFO] |  |     \- com.sac.jee.arq.spring.integraciones:mocking:jar:5.4.0.0:compile
[INFO] |  |        \- org.springframework:spring-expression:jar:5.0.4.RELEASE:compile
[INFO] |  +- com.sac.jee.arq.spring.core:arq-spring-connector-crypto:jar:5.4.0.2:compile
[INFO] |  |  +- com.sac.jee.arq.spring.core:arq-spring-connector-rest:jar:5.4.4.0:compile
[INFO] |  |  |  +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:3.2.4:compile
[INFO] |  |  |  |  +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] |  |  |  |  +- org.ow2.asm:asm:jar:5.2:compile
[INFO] |  |  |  |  +- org.apache.cxf:cxf-rt-bindings-soap:jar:3.2.4:compile
[INFO] |  |  |  |  |  +- org.apache.cxf:cxf-rt-wsdl:jar:3.2.4:compile
[INFO] |  |  |  |  |  |  \- wsdl4j:wsdl4j:jar:1.6.3:compile
[INFO] |  |  |  |  |  \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:3.2.4:compile
[INFO] |  |  |  |  +- org.apache.cxf:cxf-rt-bindings-xml:jar:3.2.4:compile
[INFO] |  |  |  |  +- org.apache.cxf:cxf-rt-frontend-simple:jar:3.2.4:compile
[INFO] |  |  |  |  \- org.apache.cxf:cxf-rt-ws-addr:jar:3.2.4:compile
[INFO] |  |  |  |     \- org.apache.cxf:cxf-rt-ws-policy:jar:3.2.4:compile
[INFO] |  |  |  |        \- org.apache.neethi:neethi:jar:3.1.1:compile
[INFO] |  |  |  +- org.apache.httpcomponents:httpmime:jar:4.5.5:compile
[INFO] |  |  |  +- com.google.api-client:google-api-client:jar:1.18.0-rc:compile
[INFO] |  |  |  |  \- com.google.oauth-client:google-oauth-client:jar:1.18.0-rc:compile
[INFO] |  |  |  +- com.google.http-client:google-http-client-jackson2:jar:1.18.0-rc:compile
[INFO] |  |  |  |  \- com.google.http-client:google-http-client:jar:1.18.0-rc:compile
[INFO] |  |  |  \- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] |  |  \- com.sac.jee.arq.spring.integraciones:caasdummy:jar:5.4.0.0:compile
[INFO] |  +- com.sac.jee.arq.spring.core:arq-spring-connector-upsilon:jar:5.4.4.4:compile
[INFO] |  +- com.sac.jee.arq.spring.integraciones:sendsmsdummy:jar:5.0.4:compile
[INFO] |  +- com.sac.jee.arq.spring.core:arq-spring-backend-ps:jar:5.4.2.0:compile
[INFO] |  |  \- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] |  +- com.sac.infrastructure.multichannel.api:multi-channel-infrastructure-api:jar:5.4.0.0:compile
[INFO] |  |  \- com.sac.jee.arq.spring.core:arq-spring-connector-semaas:jar:5.4.4.0:compile
[INFO] |  +- com.sac.jee.arq.spring.core:arq-spring-utils:jar:5.4.4.0:compile
[INFO] |  |  +- org.codehaus.jackson:jackson-mapper-asl:jar:1.8.0:compile
[INFO] |  |  \- org.codehaus.jackson:jackson-mapper-lgpl:jar:1.8.0:compile
[INFO] |  |     \- org.codehaus.jackson:jackson-core-lgpl:jar:1.8.0:compile
[INFO] |  +- com.sac.jee.arq.spring.cas.api:arq-spring-servicing-cas-api:jar:5.4.0.0:compile
[INFO] |  +- com.thoughtworks.xstream:xstream:jar:1.3.1:compile
[INFO] |  |  \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] |  +- cglib:cglib-nodep:jar:2.2:compile
[INFO] |  +- org.springframework:spring-jdbc:jar:5.0.4.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-beans:jar:5.0.4.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-core:jar:5.0.4.RELEASE:compile
[INFO] |  |  |  \- org.springframework:spring-jcl:jar:5.0.4.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-tx:jar:5.0.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-oxm:jar:5.0.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-context-support:jar:5.0.4.RELEASE:compile
[INFO] |  +- com.googlecode.ehcache-spring-annotations:ehcache-spring-annotations:jar:1.2.0:compile
[INFO] |  |  +- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  |  \- net.sf.ehcache:ehcache-core:jar:2.4.5:compile
[INFO] |  +- org.codehaus.jackson:jackson-mrbean:jar:1.8.0:compile
[INFO] |  +- org.codehaus.jackson:jackson-smile:jar:1.8.0:compile
[INFO] |  |  \- org.codehaus.jackson:jackson-core-asl:jar:1.8.0:compile
[INFO] |  +- org.codehaus.jackson:jackson-xc:jar:1.8.0:compile
[INFO] |  +- com.ibm:mq:jar:7.0.1.7:compile
[INFO] |  +- com.ibm:mqjms:jar:7.0.1.7:compile
[INFO] |  +- com.ibm.disthub2:dhbcore:jar:7.0.1.7:compile
[INFO] |  +- com.ibm.mq:jmqi:jar:7.0.1.7:compile
[INFO] |  +- com.ibm.mq:headers:jar:7.0.1.7:compile
[INFO] |  +- com.ibm.mq:commonservices:jar:7.0.1.7:compile
[INFO] |  +- com.ibm:connector:jar:1.3.0:compile
[INFO] |  +- org.apache.cxf:cxf-rt-features-clustering:jar:3.2.4:compile
[INFO] |  +- org.apache.cxf:cxf-rt-rs-service-description:jar:3.2.4:compile
[INFO] |  |  \- org.apache.cxf:cxf-rt-frontend-jaxrs:jar:3.2.4:compile
[INFO] |  +- org.apache.cxf:cxf-rt-rs-client:jar:3.2.4:compile
[INFO] |  |  \- org.apache.cxf:cxf-rt-transports-http:jar:3.2.4:compile
[INFO] |  +- commons-pool:commons-pool:jar:1.5.6:compile
[INFO] |  +- commons-dbcp:commons-dbcp:jar:1.3:compile
[INFO] |  +- commons-configuration:commons-configuration:jar:1.8:compile
[INFO] |  |  \- commons-lang:commons-lang:jar:2.6:compile
[INFO] |  +- com.hazelcast:hazelcast-all:jar:3.10.2:compile
[INFO] |  +- net.sf.flexjson:flexjson:jar:2.1:compile
[INFO] |  +- org.hibernate:hibernate-entitymanager:jar:5.2.16.Final:compile
[INFO] |  |  +- org.hibernate:hibernate-core:jar:5.2.16.Final:compile
[INFO] |  |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  |  \- org.jboss:jandex:jar:2.0.3.Final:compile
[INFO] |  |  +- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO] |  |  +- org.javassist:javassist:jar:3.22.0-GA:compile
[INFO] |  |  \- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.1.Final:compile
[INFO] |  +- com.wordnik:swagger-jaxrs_2.10:jar:1.3.0:compile
[INFO] |  |  +- org.scala-lang:scala-library:jar:2.10.0:compile
[INFO] |  |  \- com.wordnik:swagger-core_2.10:jar:1.3.0:compile
[INFO] |  |     +- com.fasterxml.jackson.module:jackson-module-scala_2.10:jar:2.1.5:compile
[INFO] |  |     |  \- org.scala-lang:scala-reflect:jar:2.10.0:compile
[INFO] |  |     +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.0.0:compile
[INFO] |  |     +- com.wordnik:swagger-annotations_2.10:jar:1.3.0:compile
[INFO] |  |     +- org.json4s:json4s-ext_2.10:jar:3.2.4:compile
[INFO] |  |     |  \- org.joda:joda-convert:jar:1.2:compile
[INFO] |  |     +- org.json4s:json4s-native_2.10:jar:3.2.4:compile
[INFO] |  |     |  \- org.json4s:json4s-core_2.10:jar:3.2.4:compile
[INFO] |  |     |     +- org.json4s:json4s-ast_2.10:jar:3.2.4:compile
[INFO] |  |     |     \- org.scala-lang:scalap:jar:2.10.0:compile
[INFO] |  |     |        \- org.scala-lang:scala-compiler:jar:2.10.0:compile
[INFO] |  |     \- org.json4s:json4s-jackson_2.10:jar:3.2.4:compile
[INFO] |  +- org.hibernate.validator:hibernate-validator:jar:6.0.9.Final:compile
[INFO] |  |  +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] |  |  \- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] |  \- org.springframework:spring-test:jar:5.0.4.RELEASE:test
[INFO] +- org.springframework.roo:org.springframework.roo.annotations:pom:2.0.0.RELEASE:compile
[INFO] |  +- org.springframework.roo:org.springframework.roo.addon.configurable.annotations:jar:2.0.0.RELEASE:compile
[INFO] |  +- org.springframework.roo:org.springframework.roo.addon.javabean.annotations:jar:2.0.0.RELEASE:compile
[INFO] |  +- org.springframework.roo:org.springframework.roo.addon.jpa.annotations:jar:2.0.0.RELEASE:compile
[INFO] |  +- org.springframework.roo:org.springframework.roo.addon.layers.repository.jpa.annotations:jar:2.0.0.RELEASE:compile
[INFO] |  +- org.springframework.roo:org.springframework.roo.addon.layers.service.annotations:jar:2.0.0.RELEASE:compile
[INFO] |  +- org.springframework.roo:org.springframework.roo.addon.plural.annotations:jar:2.0.0.RELEASE:compile
[INFO] |  +- org.springframework.roo:org.springframework.roo.addon.security.annotations:jar:2.0.0.RELEASE:compile
[INFO] |  +- org.springframework.roo:org.springframework.roo.addon.web.mvc.controller.annotations:jar:2.0.0.RELEASE:compile
[INFO] |  +- org.springframework.roo:org.springframework.roo.addon.web.mvc.exceptions.annotations:jar:2.0.0.RELEASE:compile
[INFO] |  +- org.springframework.roo:org.springframework.roo.addon.web.mvc.thymeleaf.annotations:jar:2.0.0.RELEASE:compile
[INFO] |  +- org.springframework.roo:org.springframework.roo.classpath:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.apache.felix:org.apache.felix.scr.annotations:jar:1.9.12:compile
[INFO] |  |  +- org.springframework.roo:org.springframework.roo.file.monitor:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.roo:org.springframework.roo.file.undo:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.roo:org.springframework.roo.metadata:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.roo:org.springframework.roo.model:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.roo:org.springframework.roo.process.manager:jar:2.0.0.RELEASE:compile
[INFO] |  |  |  \- org.springframework.roo:org.springframework.roo.shell.osgi:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.roo:org.springframework.roo.project:jar:2.0.0.RELEASE:compile
[INFO] |  |  |  \- org.apache.felix:org.apache.felix.framework:jar:5.4.0:compile
[INFO] |  |  +- org.springframework.roo:org.springframework.roo.shell:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.roo:org.springframework.roo.support:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.roo:org.springframework.roo.settings:jar:2.0.0.RELEASE:compile
[INFO] |  |  |  \- org.springframework.roo:org.springframework.roo.propfiles.manager:jar:2.0.0.RELEASE:compile
[INFO] |  |  \- org.springframework.roo.wrapping:org.springframework.roo.wrapping.inflector:jar:0.7.0.010:compile
[INFO] |  +- org.springframework.roo:org.springframework.roo.addon.dto.annotations:jar:2.0.0.RELEASE:compile
[INFO] |  \- org.springframework.roo:org.springframework.roo.addon.ws.annotations:jar:2.0.0.RELEASE:compile
[INFO] +- com.sac.enax.test:enax_bdd_test_core:jar:1.1.7:compile
[INFO] |  +- org.glassfish.jersey.core:jersey-common:jar:2.14:compile
[INFO] |  |  +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
[INFO] |  |  +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.14:compile
[INFO] |  |  +- org.glassfish.hk2.external:javax.inject:jar:2.4.0-b06:compile
[INFO] |  |  +- org.glassfish.hk2:hk2-locator:jar:2.4.0-b06:compile
[INFO] |  |  \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
[INFO] |  +- javax.inject:javax.inject:jar:1:compile
[INFO] |  +- org.glassfish.hk2:hk2:jar:2.4.0-b06:compile
[INFO] |  |  +- org.glassfish.hk2:config-types:jar:2.4.0-b06:compile
[INFO] |  |  +- org.glassfish.hk2:core:jar:2.4.0-b06:compile
[INFO] |  |  +- org.glassfish.hk2:hk2-config:jar:2.4.0-b06:compile
[INFO] |  |  |  +- org.jvnet:tiger-types:jar:1.4:compile
[INFO] |  |  |  \- org.glassfish.hk2.external:bean-validator:jar:2.4.0-b06:compile
[INFO] |  |  +- org.glassfish.hk2:hk2-runlevel:jar:2.4.0-b06:compile
[INFO] |  |  \- org.glassfish.hk2:class-model:jar:2.4.0-b06:compile
[INFO] |  |     \- org.glassfish.hk2.external:asm-all-repackaged:jar:2.4.0-b06:compile
[INFO] |  +- com.google.inject:guice:jar:4.0:compile
[INFO] |  +- commons-io:commons-io:jar:2.4:compile
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.8.1:compile
[INFO] |  +- info.cukes:gherkin:jar:2.12.2:compile
[INFO] |  +- com.jayway.jsonpath:json-path-assert:jar:2.1.0:compile
[INFO] |  |  \- com.jayway.jsonpath:json-path:jar:2.1.0:compile
[INFO] |  |     \- net.minidev:json-smart:jar:2.2:compile
[INFO] |  |        \- net.minidev:accessors-smart:jar:1.1:compile
[INFO] |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.7.1:compile
[INFO] |  |  \- org.yaml:snakeyaml:jar:1.15:compile
[INFO] |  +- com.github.fge:json-schema-validator:jar:2.2.6:compile
[INFO] |  |  +- com.google.code.findbugs:jsr305:jar:3.0.0:compile
[INFO] |  |  +- joda-time:joda-time:jar:2.3:compile
[INFO] |  |  +- com.googlecode.libphonenumber:libphonenumber:jar:6.2:compile
[INFO] |  |  +- com.github.fge:json-schema-core:jar:1.2.5:compile
[INFO] |  |  |  +- com.github.fge:uri-template:jar:0.9:compile
[INFO] |  |  |  |  \- com.github.fge:msg-simple:jar:1.1:compile
[INFO] |  |  |  |     \- com.github.fge:btf:jar:1.2:compile
[INFO] |  |  |  +- com.github.fge:jackson-coreutils:jar:1.8:compile
[INFO] |  |  |  \- org.mozilla:rhino:jar:1.7R4:compile
[INFO] |  |  +- javax.mail:mailapi:jar:1.4.3:compile
[INFO] |  |  \- net.sf.jopt-simple:jopt-simple:jar:4.6:compile
[INFO] |  +- org.springframework:spring-context:jar:4.2.3.RELEASE:compile
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.5:compile
[INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.7.7:compile
[INFO] |  +- org.slf4j:slf4j-log4j12:jar:1.7.12:compile
[INFO] |  +- com.tngtech.java:junit-dataprovider:jar:1.5.0:compile
[INFO] |  |  \- junit:junit-dep:jar:4.8.2:compile
[INFO] |  +- info.cukes:cucumber-java:jar:1.2.2:compile
[INFO] |  |  \- info.cukes:cucumber-core:jar:1.2.2:compile
[INFO] |  |     +- info.cukes:cucumber-html:jar:0.2.3:compile
[INFO] |  |     \- info.cukes:cucumber-jvm-deps:jar:1.0.3:compile
[INFO] |  +- info.cukes:cucumber-junit:jar:1.2.2:compile
[INFO] |  +- org.powermock:powermock-module-junit4:jar:1.7.3:test
[INFO] |  +- org.powermock:powermock-api-mockito:jar:1.5.5:compile
[INFO] |  +- org.powermock:powermock-api-support:jar:1.4.12:compile
[INFO] |  |  +- org.powermock:powermock-core:jar:1.4.12:compile
[INFO] |  |  \- org.powermock:powermock-reflect:jar:1.4.12:compile
[INFO] |  +- org.powermock:powermock-module-junit4-common:jar:1.4.12:compile
[INFO] |  +- com.google.code.findbugs:annotations:jar:1.3.9:compile
[INFO] |  \- com.sac.enax.jjschema:jjschema:jar:0.9:compile
[INFO] |     \- com.fasterxml.jackson.module:jackson-module-jsonSchema:jar:2.1.0:compile
[INFO] +- com.sac.enax.global.bdd:enax_bdd_test_impl:jar:1.1.5:compile
[INFO] +- org.glassfish.hk2:hk2-api:jar:2.5.0-b61:test
[INFO] |  +- org.glassfish.hk2:hk2-utils:jar:2.5.0-b61:compile
[INFO] |  \- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.5.0-b61:compile
[INFO] +- com.google.guava:guava:jar:18.0:compile
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.5.1:test
[INFO] |  +- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  \- commons-codec:commons-codec:jar:1.9:compile
[INFO] +- org.apache.httpcomponents:httpcore:jar:4.4.3:test
[INFO] +- com.sun.jersey:jersey-core:jar:1.19.2:test
[INFO] |  \- javax.ws.rs:jsr311-api:jar:1.1.1:test
[INFO] +- uk.co.jemos.podam:podam:jar:7.2.3.RELEASE:compile
[INFO] |  +- net.jcip:jcip-annotations:jar:1.0:compile
[INFO] |  \- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] +- com.sac.jee.arq.spring.core:arq-spring-backend-commons:jar:5.4.2.0:compile
[INFO] |  +- com.sac.jee.arq.spring.core:arq-spring-core-api:jar:5.4.4.0:compile
[INFO] |  |  +- com.sac.secarq.caas2:caascore-channel-infrastructure-seg:jar:1.0.11:compile
[INFO] |  |  +- org.apache.cxf:cxf-rt-rs-extension-search:jar:3.2.4:compile
[INFO] |  |  \- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] |  +- javax.persistence:persistence-api:jar:1.0:compile
[INFO] |  +- org.springframework:spring-aspects:jar:5.0.4.RELEASE:compile
[INFO] |  +- org.aspectj:aspectjrt:jar:1.9.0:compile
[INFO] |  +- org.aspectj:aspectjtools:jar:1.9.0:compile
[INFO] |  +- org.aspectj:aspectjweaver:jar:1.9.0:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.5:compile
[INFO] |  \- org.reflections:reflections:jar:0.9.8:compile
[INFO] |     +- javassist:javassist:jar:3.12.1.GA:compile
[INFO] |     \- dom4j:dom4j:jar:1.6.1:compile
[INFO] |        \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] +- org.mapstruct:mapstruct-jdk8:jar:1.2.0.Final:compile
[INFO] +- com.sac.enax:enax_validation:jar:1.0.4:compile
[INFO] |  +- com.sac.jee.arq.spring.core:arq-spring-restutils:jar:5.4.0.0:compile
[INFO] |  |  +- cz.jirutka.rsql:rsql-parser:jar:2.1.0:compile
[INFO] |  |  +- org.springframework.data:spring-data-jpa:jar:2.0.4.RELEASE:compile
[INFO] |  |  |  +- org.springframework.data:spring-data-commons:jar:2.0.4.RELEASE:compile
[INFO] |  |  |  \- org.springframework:spring-orm:jar:5.0.4.RELEASE:compile
[INFO] |  |  \- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.2.Final:compile
[INFO] |  +- com.sac.jee.arq.spring.core:arq-spring-core-spi:jar:1.8.1:compile
[INFO] |  \- com.sac.jee.arq.spring.core:arq-spring-connector-host-api:jar:1.8.0:compile
[INFO] |     \- org.springframework:spring-aop:jar:3.2.3.RELEASE:compile
[INFO] +- org.hibernate.validator:hibernate-validator-annotation-processor:jar:6.0.9.Final:compile
[INFO] +- javax.el:javax.el-api:jar:3.0.1-b06:compile
[INFO] +- org.glassfish.web:javax.el:jar:2.2.6:compile
[INFO] +- junit:junit:jar:4.9:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.1:compile
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.9.9:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.5:compile
[INFO] +- org.mockito:mockito-all:jar:1.9.5:test
[INFO] +- org.mockito:mockito-core:jar:2.13.0:test
[INFO] |  +- net.bytebuddy:byte-buddy:jar:1.8.17:compile
[INFO] |  +- net.bytebuddy:byte-buddy-agent:jar:1.7.9:test
[INFO] |  \- org.objenesis:objenesis:jar:2.6:compile
[INFO] \- com.openpojo:openpojo:jar:0.8.9:compile

我没有发现 hk2 jar 的问题,也许它与其他依赖项不兼容。

最佳答案

您有两个不同版本的 hk2,第一个版本来自此处:

[INFO] +- com.sac.enax.test:enax_bdd_test_core:jar:1.1.7:compile
[INFO] |  +- org.glassfish.hk2:hk2:jar:2.4.0-b06:compile

第二个作为直接依赖项:

[INFO] +- org.glassfish.hk2:hk2-api:jar:2.5.0-b61:test
[INFO] |  +- org.glassfish.hk2:hk2-utils:jar:2.5.0-b61:compile

方法org.glassfish.hk2.utilities.general.GeneralUtilities.getSystemProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;出现在版本2.4.0-b06中hk2-utils,但随后在版本 2.5.0-b61 之前被删除。编辑您的 pom 以调整对 2.4.0-b06 的显式声明依赖项,或将旧版本拉至新版本的中间依赖项。

关于java - 测试cucumber时出现错误NoSuchMethodError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57178809/

相关文章:

java - Cucumber:许多示例行 VS 许多场景轮廓

java - cucumber 中的日期对象

Java 和 R 集成

java - 在 eclipse maven 中链接源文件夹时出现错误

java - 在gradle中创建一个shadow jar?

java - 系统属性在 Maven 项目中始终为 null

java - JSTL URL 标签在 Heroku 上不起作用

java - 如何使用 Java 将 vector 插入 Cassandra?

java - 如何在每个测试类都有自己的并行 JVM 的情况下运行 Maven surefire?

ruby-on-rails - cucumber + capybara : Problem with a scenario that redirects the browser outside of my app